I have created Web API which allows messages to be sent to the Queue. My Web API is designed with CQRS and DDD in mind. I want my message consumer to always be waiting for any messages on the queue to receive. Currently the way its done, this will only read messages if I make a request to the API to hit the method. Is there a way of either using console application or something that will always be running to consume messages at anytime given without having to make a request from the Web Api. So more of a automation task ? If so, how do I go about with it i.e. if its console app how would I keep it always running (IIS ?) and is there way to use Dependency Injection as I need to consume the message then send to my repository which lives on separate solution. ? or a way to make EasyNetQ run at start up ?
EasyNetQ / RabbitMQ consuming events in Web API
1.2k views Asked by hello world At
1
There are 1 answers
Related Questions in ASP.NET-WEB-API
- Log to Dynatrace using Serilog and web.config .NET Framework API
- How to create a REST API with .NET Framework?
- ASP.NET Core Background task with service container
- App gateway closing connection after 100 requests
- Web API works with Windows authentication enabled when consumed via Swagger but throws an unauthorized issue when accessed through web app
- The 'GetUriByAction' method in the LinkGenerator class in Asp.Net Core is not defined in the Repository layer of the project
- Entity Tracking Conflict when Authenticating Users in ASP.NET Core API
- Class validation on response body in .NET WebApi
- My ASP.NET server does not work and I am wondering what's missing, when I open Swagger, I get error 500
- How to split Serilog log file into multiple files?
- Response payload is not odata payload
- How can I upload picture
- Web Forms aspx - PostAsync Web API
- do you know any free reporting services like devexpress or boldreports?
- WebAPI don't deserialize JSON but same payload works in Swagger
Related Questions in RABBITMQ
- When sending message getting Exception: org.springframework.amqp.AmqpIOException: java.io.IOException
- How to publish messages to RabbitMQ by using Multi threading?
- How should it be handled if the number of messages is less than the number of threads?
- Apply a dynamic group value in Spring Cloud Stream
- Two rabbitmq queues with exactly same configuration one of them is not created automatically (Spring Boot 3 RabbitMQ)
- Does Spring AMQP 3.13 support quorum queues?
- IServiceCollectionConfigurator' does not contain a definition for 'UsingRabbitMq'
- Troubleshooting topic exchanges in php-amqplib
- How to Use AWS Systems Manager (SSM) for Accessing a RabbitMQ Broker in an AWS VPC Private Subnet
- Rabbitmq on azure container app error 405 on trying to create queue on web management
- Cannot connect to RabbitMQ from Flower/Celery
- How to Extract Queue Name, Priority, and Message ID from RabbitMQ Inbound Endpoint Messages in WSO2 MI 4.2?
- Spring Boot RabbitMQ consumer application can not fetch an object sent by producer application in Java 17
- Is it possible to implement an event-driven architecture using Redis Streams?
- Scaling Nuclio With KEDA Based on Queue Length: Error ScaledObject Name is Not Specified
Related Questions in CQRS
- Domain driven design CQRS with multiple aggregates and bounded context
- Where do I put business logic when implementing CQRS pattern using Mediatr in a .Net Clean Architecture application?
- Separating command from query in the spring boot CQRS projects(Multi module)
- Prevent duplicate records in ASP.NET Core app with CQRS architecture
- Service IValidator Array
- Transactionnal events with NestJS & CQRS
- What should be stored in materialized view when implementing event driven CQRS?
- Operations without writing to the DB In DDD
- What is the alternate solution for AddMediatR in the .NET Core Web API Program.CS file?
- Akka: currentEventsByPersistenceId always returns zero for 'eventEnvelope.timestamp'
- Does a command persist state itself, when we combine CQRS with Event Sourcing, or is it delegating to the EventBus?
- How to handle one to many relationship in CQRS/ES/Saga architecture?
- Communication between the writing model and the reading model in CQRS + DDD
- Issue with CQRS Implementation in NestJS with Mongoose
- How to specify which handler to route Mediator query/command?
Related Questions in EVENT-SOURCING
- AuditLog Events in EventSourcing
- EventFlow NETCore 8 - ReadModelByIdQuery invalid parsing data from database
- EventStore: Event does not exist for stream:
- Akka: currentEventsByPersistenceId always returns zero for 'eventEnvelope.timestamp'
- Does a command persist state itself, when we combine CQRS with Event Sourcing, or is it delegating to the EventBus?
- How to handle one to many relationship in CQRS/ES/Saga architecture?
- MartenDB serializer issue
- EventStore batch event reading from $all via gRPC
- In Akka Typed Event Sourcing is it common to use a single db (the same event journal) for multiple typed persistent entities?
- DDD+CQRS+EventSourcing how to make sure projections are up to date?
- Read stream from EventStore without "stream doesn't exist exception"
- How to wait for all Disruptor messages to be consumed in a test case
- Appending events to Marten from an outbox and guarantee ordering
- What is the Logic Behind Synchronization in CQRS with Separate Storages?
- Event Sourcing: Can I describe the parent object state via its member object events?
Related Questions in EASYNETQ
- Send/Receive in easynetq with persistance layer
- why Just one of two message is delivered in rabbitmq?
- EasyNetQ subscribe throws taskCanceledException
- Single thread app is holding messages from other queue while processing one message -RMQ
- EasyNetQ consuming behaviour and modular monolith
- EasynetQ autosubscribe throwing error: *System.ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name'*
- EasyNetQ - prefetchcount parameter ignored
- EasynetQ AutoSubscriber setup for comsumers that need services injected
- Set up only synchronous blocking calls in IBus.PubSub.SubscribeAsync()?
- EasyNetQ deserialize: why does my message not succeed and typeName is "null"?
- How to ensure RabbitMQ message is not duplicated when handling concurrent messages in multiple pods?
- EasyNetQ TaskCanceledException for Request/Response
- What port is used on the client machine to send messages to rabbitmq?
- RabbitMQ queue name define
- RabbitMq Server is giving me the message "missed heartbeats from client"
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The best way to handle this situation in your case is to subscribe to bus events using AMPQ through EasyNetQ library. The recommended way of hosting it is by writing a windows service using topshelf library and subscribe to bus events inside that service on start.
IIS processes and threads are not reliable for such tasks as they are designed to be recycled on a regular basis which may cause some instabilities and inconsistencies in your application.
It is better to create a separate question for this, as it is obviously off-topic. Also, it requires a further elaboration as it is not clear what specifically you are struggling with.