Questions tagged [middleware]

Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue".

Middleware is a software component (or components) that sits "in the middle" between applications and the operating system. Typically, middleware will facilitate application development by providing services such as communications, file access, or thread locking that have a common Application Programming Interface (API) across multiple operating systems.

Communications Middleware is a specific kind of middleware that allows for interprocess communications (on one machine or across a network). The purpose of Communications Middleware is to simplify the designing, programming, and managing of software applications by streamlining the way these applications receive and process data. Communications Middleware simplifies writing communications software while providing sophisticated built-in features, reducing development costs.

Examples of communications middleware include:

4333 questions
13
votes
1 answer

IIS Custom field logging through HTTP Request in ASP NET Core

I have enabled IIS logging with custom fields for my website. Previously in MVC, I have used HTTPHandlers and Module to add the above fields to the HTTP Request headers. web.config:
Dinesh M
  • 1,026
  • 8
  • 23
13
votes
2 answers

Lumen middleware sort (priority)

I'm using "laravel/lumen-framework": "5.7.*" I have two middlewares, first one AuthTokenAuthenticate that should be applied to all the routes, so its defined in bootstrap/app.php like $app->middleware([ …
Seva Kalashnikov
  • 4,262
  • 2
  • 21
  • 36
13
votes
2 answers

What does "bindings" middleware do in Laravel 5.6?

Just as per the title. Default api middleware in Laravel 5.6 is listed in Kernel.php as: protected $middlewareGroups = [ 'api' => [ 'throttle:60,1', 'bindings', ], ]; I'd appreciate a layman's explanation of what bindings…
Inigo
  • 8,110
  • 18
  • 62
  • 110
13
votes
2 answers

Are middlewares an implementation of the Decorator pattern?

In Django, there is the idea of Middleware. It consists of changing the requests and passing it down to the next middleware and so on, and doing the reverse with the responses. Are middlewares implementation of the design pattern Decorator? Are they…
thyago stall
  • 1,654
  • 3
  • 16
  • 30
13
votes
1 answer

ReflectionException - Middleware class does not exist Laravel 5.2

I am building an API with stateless HTTP basic authentication in Laravel 5.2, as per documentation Stateless HTTP Basic Authentication , I have created following Middleware app/Http/Middleware/AuthenticateOnceWithBasicAuth.php
Devendra Verma
  • 938
  • 1
  • 13
  • 29
13
votes
4 answers

Laravel RoleMiddleware, class role not found

I'm trying to add a simple middleware to check if a user matches a role. I'm running into an issue when I use the middleware, I get an Exception: ReflectionException: class role does not exist I do not attempt to call a class named role so I…
Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95
13
votes
4 answers

How to hold messages in JMS Message Queue if there are any error after consuming the message?

My scenario is - I post message in to queue and once message is consumed I am sending it to third party middleware application. If that middleware application is down then my posted message gone for toss. I do not want to lose that message if…
Dinesh M
  • 674
  • 2
  • 7
  • 18
13
votes
2 answers

get the url in the middleware laravel

I have my middleware and inside it I am trying to reach the current url of the page. so I did something like that: $url = Request::url(); and I used: use App\Http\Requests; use Illuminate\Http\Request; but I keep getting the following…
TheDragoner
  • 273
  • 2
  • 6
  • 17
13
votes
1 answer

Looking for Example of Faraday Middleware with Error checking

I am looking for an example of Faraday Middleware that handles http (status code) errors on requests and additionally network timeouts. After reading the docs for Faraday and it's middleware it's my understanding that this is one of middleware's…
user3084728
  • 565
  • 1
  • 8
  • 16
13
votes
1 answer

Set Ring-Anti-Forgery CSRF header token

I'm attempting to implement the Ring-Anti-Forgery library via setting the X-CSRF-Token in the header. Since I am using static html files I found the built-in hiccup helper, which sets the token in the form, to be useless. This is my first stab at…
jasonshell
  • 352
  • 6
  • 12
13
votes
1 answer

Options for Client Server Communication in Android

I'm currently in the research phase of my dissertation project. My project is a ticket booking system for a mobile device and I have chosen to target Android. I anticipate the need for a client/server architecture with a central server, and so am…
chrisbunney
  • 5,819
  • 7
  • 48
  • 67
13
votes
2 answers

Mongoose - how to tap schema middleware into the 'init' event?

It is suggested in the Mongoose docs that I should be able to control the flow using middleware that plugs in to the "init" hook. However, I have so far had success only with "save" and "validate". When I do something like this, neither of these…
ragulka
  • 4,312
  • 7
  • 48
  • 73
13
votes
2 answers

How do I pass variables from Connect's middleware into app.get-action?

I would like to create kind of a before filter which allows me to make the current user available in all actions. The followint approach works well and I didn't even need to declare a global variable: app.use(function(req, res, next){ …
YMMD
  • 3,730
  • 2
  • 32
  • 43
12
votes
4 answers

How do I get query string params in NextJS middleware

I'm using NextJS middleware and can get the nextUrl object from the request, which includes things like pathname, but how do I get query string parameters from within the middleware? I can see it comes back as part of the string returned by href…
user7409110
  • 289
  • 1
  • 5
  • 14
12
votes
4 answers

Java/Python communication via message broker

What is a good solution for communication via message broker that supports both (C)Python and Java/JMS applications? My particular requirements are: open source solution Available on Linux-based systems No rendezvous between sender and receiver…
wberry
  • 18,519
  • 8
  • 53
  • 85