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 best solutions below
Related Questions in ASP.NET-WEB-API
- Implement Onfailure in webApi controller
- WebApi: Reading errors
- Why web API return 404 when deploy to IIS
- One Web API calls the other Web APIs
- colon(:) in url causes error in asp.net
- Make a per-web-application object available to Web API and SignalR controllers
- Using Azure MobileServices library with my own LAN WebApi
- redirect to actionResult method from an api
- How to catch postpack result to Web Api
- Exposing webapi to third party
- .net Web Api 2 Owin authentication token expires suddenly and often on IIS 8.5
- Can you use the same token in ADFS for 2 different relying parties?
- Does 'api/SomeEntity/ForOtherEntity/{otherEntityId}' break REST?
- Generic webAPI method based on parameter types of arrays
- Where can I find user identity when using webapi with Windows Authentication on IIS8
Related Questions in RABBITMQ
- How to handle RabbitMQ with mobile apps
- Is there a size limit on a RabbitMQ message header?
- ECONNRESET on node.js RabbitMQ consumer in Azure
- How to use RabbitMQ http api to see what queue had a messages in a ready state
- Using same channel for RPC call in RabbitMQ
- Unable to install RabbitMQ using puppet due to curl error
- Spring amqp RPC request to rabbitmq getting timeouts
- Camel rabbitmq + convertSendAndReceive() : Could not convert incoming message with content-type [null]
- How to add initial users when starting a RabbitMQ Docker container?
- Rabbitmq 3.5.1 slow publish rate
- Message Queues: Per Message Guarantees
- RabbitMQ pika error
- Pika with RabbitMQ: Message distribution accross multiple consumer Applications from a single Queue
- Masstransit temporary queue
- spring boot rabbitmq MappingJackson2MessageConverter custom object conversion
Related Questions in CQRS
- Correlating aggregates by Saga ID instead of an additional aggregate root
- Command Bus/Dispatcher and Handler registration without Dependency Injection
- WPF Line Of Business Application Architecture
- Command Query Responsibility Segregation (CQRS) / Event Sourcing (ES): Why use it? How to address consistency issues?
- Defining aggregate roots when invariants exist within a list
- Domain Model with Event Sourcing
- DDD\CQRS\Event Sourcing and request historical data
- CQRS + ES - Where to query Data needed for business logic?
- CQRS, multiple write nodes for a single aggregate entry, while maintaining concurrency
- Event sourcing microservices: How to manage timestamp
- In context of CQRS and DDD how would you handle slightly varying use cases?
- EasyNetQ / RabbitMQ consuming events in Web API
- Validation and synchronous commands in CQRS
- Read model for aggregate in DDD CQRS ES
- How to generate identities when source of truth is Apache Kafka?
Related Questions in EVENT-SOURCING
- Correlating aggregates by Saga ID instead of an additional aggregate root
- Command Query Responsibility Segregation (CQRS) / Event Sourcing (ES): Why use it? How to address consistency issues?
- Defining aggregate roots when invariants exist within a list
- Domain Model with Event Sourcing
- CQRS + ES - Where to query Data needed for business logic?
- Event sourcing microservices: How to manage timestamp
- Keeping data models in sync (MySQL and Neo4j)
- Is it ok to have FAT events with event sourcing?
- Eventsourcing in Apache Kafka
- EasyNetQ / RabbitMQ consuming events in Web API
- EventSourcing in occassionally connected systems: what if there are two servers?
- akka persistence deleting journal entries
- How to generate identities when source of truth is Apache Kafka?
- How to store & read events specific to an Aggregate from Kafka in an ES/CQRS application?
- Multiple distributed event stores for data governance working together
Related Questions in EASYNETQ
- How to do error handling with EasyNetQ / RabbitMQ
- EasyNetQ/RabbitMQ - Publishing a message based on topic
- How to handle failed publish with RabbitMq?
- EasyNetQ publish and consume
- EasyNetQ / RabbitMQ consuming events in Web API
- Microservice and RabbitMQ
- Declare response queue with specific name for Request/Response pattern in EasyNetQ
- Topic based subscribe and publish with EasyNetQ
- Delete a message once it's consumed?
- Polymorphic Request-Response in EasyNetQ
- Send/Receive in easynetq with persistance layer
- RabbitMQ Queue Expires While in Use
- EasyNetQ not reading messages from queue published with RabbitMQ Java Client API
- Prevent collisions when working with RabbitMq from two or more instances of the same app
- Multiple vhost connection inside same project (Subscribe / Publish)
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)
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?
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.