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
25
votes
4 answers

Advantages of HornetQ vs ActiveMQ vs Qpid

I was browsing for an open source messaging software and after some good bit of research I came across these three products. I've taken these out for a preliminary test drive, having had them handle messages for queues and topics, and from what I've…
Raymond Linear
  • 251
  • 1
  • 3
  • 3
25
votes
8 answers

How can I use body-parser with LoopBack?

I see that LoopBack has the Express 3.x middleware built-in. Indeed, body-parser is in loopback/node_modules. But I cannot figure out how to use it as middleware. I have never worked with Express 3.x, so maybe it's just that. require does not work,…
Antrikshy
  • 2,918
  • 4
  • 31
  • 65
24
votes
3 answers

How to properly handle errors in Express?

I am beginning to work with Express JS and have run into an issue. I can't seem to figure out the proper way to handle errors. For example, I have a web services API that serves an object called "event". I'd like to return a simple string of "cannot…
YWCA Hello
  • 2,997
  • 4
  • 29
  • 40
24
votes
3 answers

Passing parameters to middleware in Laravel

Let's say I have a route pointing to middleware; Route::get("/user/{id}", ['middleware' => 'auth', function ($id) { }]); And my middleware code is as follows: public function handle($request, Closure $next) { return $next($request); } If I…
athene
  • 408
  • 1
  • 6
  • 15
24
votes
5 answers

What is the "env" variable in Rack middleware?

I know a Rack middleware filter is a Ruby class with an initialize and a call method. I know the call method takes an "env" argument. Something like this: class MyFilter def initialize(app) end def call(env) end end My question is: what…
User314159
  • 7,733
  • 9
  • 39
  • 63
23
votes
2 answers

How can I get a list of registered middleware in ASP.NET Core?

In ASP.NET Core, you can register new middleware into the request processing pipeline during the Configure method of the startup class you're using for your web host builder by using app.UseMiddleware(...). During debugging, how do I get a list of…
Jez
  • 27,951
  • 32
  • 136
  • 233
23
votes
2 answers

Axios middleware to use in all instances of axios

I'm using axios in my react app using import axios from 'axios in many of my scripts. I want to use sort of a middleware that is invoked for all axios calls/errors. How do I approach this?
Shakil Ahmed
  • 389
  • 1
  • 3
  • 11
23
votes
3 answers

.net-core middleware return blank result

Im making a website with an API, the API needs validation so the user only gets his own data. I have written the following middleware to validate the login. public class ApiAuthenticationMiddleware { private readonly RequestDelegate _next; …
Sven van den Boogaart
  • 11,833
  • 21
  • 86
  • 169
23
votes
3 answers

Difference between app, services and middleware in mvc6

I'm trying to understand the concept of middleware in MVC6. It is still kind of vague to me. I don't really see the differences between a few "standard" variables you get in the Startup class. As far as I can tell there are 3 different ways to tell…
Vivendi
  • 20,047
  • 25
  • 121
  • 196
22
votes
5 answers

Difference between queue manager and message broker

What is the difference between a Websphere Message Broker and a Queue Manager. I guess the queue manager puts messages in the queue, takes messages out of the queue, moves messages to backout queues etc. So what is the job of the broker? Does it…
Victor
  • 16,609
  • 71
  • 229
  • 409
21
votes
4 answers

Async/Await in Express Middleware

I'm having trouble understanding how to properly write middleware in Express that utilizes async/await, but doesn't leave a Promise floating in the ether after it's execution. I've read a ton of blogs and StackOverflow posts, and it seems like there…
djs
  • 3,947
  • 3
  • 14
  • 28
21
votes
2 answers

How to pass an additional parameter to passport.authenticate

(I already do fbStrategy.passReqToCallback = true ) I am riffing off https://scotch.io/tutorials/easy-node-authentication-linking-all-accounts-together but want to use this social authentication service for multiple apps, ex: the one that controls…
mcktimo
  • 1,440
  • 4
  • 19
  • 35
21
votes
7 answers

disable web middleware for specific routes in laravel 5.2

I want to guest users have access to home page but in built in authentication process laravel redirects to login page. how can i give guest users access to home page? my routes.php: Route::group(['middleware' => 'web'], function ()…
masoud vali
  • 1,528
  • 2
  • 18
  • 29
21
votes
3 answers

WSGI: what's the purpose of start_response function

Could you supply a real-life example of WSGI start_response function? (Web-server provides that function to wsgi application) I can't understand the purpose of introducing the start_response. (I've read like 10 identical texts about the WSGI…
Boris Burkov
  • 13,420
  • 17
  • 74
  • 109
21
votes
1 answer

Express app.get documentation

I am looking for some documentation on the app.get function of express.js. app.get( '/path', middleware(), function(req, res) { res.redirect('/'); } ); The example above takes three parameters. The normal docs only show…
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424