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
1
vote
0 answers

MQTT Mosquitto: is there a way to pre-process topic published data before it's sent to all subscribers? (i.e. middleware)

I'm running Mosquitto (latest). Is it possible to hook/define a "middleware processor" which executes between Mosquitto receiving a Publish from a client and sending the payload to subscribers, giving me the ability to manipulate the payload before…
Ryan Griggs
  • 2,457
  • 2
  • 35
  • 58
1
vote
1 answer

Filter XYZ not containing nodes using XSLT

I am new to xslt transformations and we have a requirement of payload transformation using xslt Can you please help me to filter XYZ not containing nodes for the below input Input:
vijay
  • 13
  • 5
1
vote
1 answer

Blocked code while using middleware and dependency injections to log requests in FastAPI(Python)

Please, help me to coupe the problem of blocked code. I am using FastAPI. I've done with a middleware to log incoming requests and server responses for them. @app.middleware("http") async def log_request(request: Request, call_next): # Code to…
1
vote
1 answer

Call to undefined method Illuminate\Database\Eloquent\Builder::mapInto()

I get the following error when adding to the command line like this: error: Call to undefined method Illuminate\Database\Eloquent\Builder::mapInto() This is my code: If i leave out the command line Project::where('user_id', auth()->user()->id) go…
1
vote
1 answer

Accessing TempData in Middleware in a asp.net 5.0 web api project

I have two applications running together at the same time. I was trying to find a way to be able to use TempData in my own type of class and after reading it I implemented it in my Middleware for my MVC project which works smoothly. However, when I…
MarkCo
  • 810
  • 2
  • 12
  • 29
1
vote
1 answer

Pass username into headers using httpContext asp.net core mvc

I am wanting to pass a variable into headers in my middleware. In my controller I am using username to hold the value that was entered in View. Then I was thinking if I use TempData I could be pass the value of username to my middleware class and…
MarkCo
  • 810
  • 2
  • 12
  • 29
1
vote
2 answers

improve if else conditions in Laravel

I have a Laravel Project which is about to go Live in like two days. I have a lot of quires running in backend and on frontend. I am working on improving speed of application as there will be lot more users in live production. In my controllers I…
1
vote
1 answer

why does express middleware not working in separate files

I want to broke down my routers into separate file rather than keeping all API routes in a single file. So i tried to identify user URL using a middle ware and call the api according to the url as you seeing bellow but middleware function is not…
1
vote
2 answers

Relation between Authorization middleware and filter Asp.net core

I was watching tutorial about Asp .net core and I was wondering the difference between filters and middleware and after some research I found the answer of my question that middleware pipeline is proceed before filter pipeline. but I face with…
AlirezaEiji
  • 29
  • 1
  • 5
1
vote
1 answer

JS: When is Function.prototype.apply() or call() necessary to refer to this

I am learning JS. I was working with Mongoose and I wanted do pass a function and parameter(s) to a callback, but I have to use call() instead. // Car is a model. Using Express in Node.js express.Router().route('/') .get((req,res,next)=>{ …
okzoomer
  • 308
  • 1
  • 11
1
vote
0 answers

Using Larval middleware to redirect user to seperate domain

hope someone can assist me with this. so am trying to tackle an issue on my website just to summarize it. I want to add a feature when a user tries to make a payment from my website or subscribe to a plan I want them to be redirected to my company…
1
vote
1 answer

Unsure as to why no cookie is being sent back to my localhost client when using express-session

Having issues with node express-session and basically just trying to understand how it all works with regards to cookies and my session store within my postgres database. For starters, I'm not sure why I don't receive a session id cookie within my…
ArthurJ
  • 777
  • 1
  • 14
  • 39
1
vote
1 answer

Request input returns null in Middleware

I'm guarding a route via a middleware check for a valid token, like thus;- http://localhost:8097/init/my-secret-token Route::get('/init/{token}', [MyController::class, 'init'])->middleware('validToken'); // Kernel.php protected $routeMiddleware…
cookie
  • 2,546
  • 7
  • 29
  • 55
1
vote
1 answer

How to catch a Rack RangeError in Rails 6

I have a Rails 6 app to which users can upload CSV files. Rails/Rack imposes a limit in the number of params that can be included in a request, and I've set this to a size larger than likely submissions to my app. However, I would like to return a…
JohnP
  • 1,229
  • 6
  • 24
1
vote
1 answer

React Redux applyMiddleware invalid number of arguments

I can't seem to figure this out. When I use the function applyMiddleware I am unable to pass any arguments in as I get the error invalid number of arguments, expected 0. import {applyMiddleware, createStore} from "redux"; import logger from…
Chris
  • 51
  • 1
  • 8