Comments (3)
Basically when you send a message to RabbitMQ you have some properties for this message and a payload. One of the properties is the correlation_id.
EasyNetQ, as the name shows, tries to simplify your life. So when you send a message (via a class), then it creates a RabbitMQ message with the serialized message as payload. While doing this it also generates a CorrelationId to give this message some kind of unique identifier, (The default implemantion is just Guid.NewGuid().ToString(), but you can replace it)
More or less this happens behind the scenes without any interaction necessary:
bus.SendReceive.Send(myMessage)
from easynetq.
@GeraldLx : Many thanks for your reply. How can we create this CreateBasicProperties()
of EasyNetQ so that I override the default behavior and our correlationId.
from easynetq.
EasyNetQ has now many years of development behind, so there are a view ways to achieve this.
There is an interface ICorrelationIdGenerationStrategy which has one method GetCorrelationId. Just make your own version and register it in the DI when creating the bus.
You can also go over the Advanced bus. By going this route you are on a way deeper level where you have full control about the generated message. This way you can generate the properties manually and set the CorrelationId while sending.
You can also combine these. The logic behind the scenes is that EasyNetQ checks, if the correlation id was set otherwise it fills the correlation id with the value provided by the generation strategy.
from easynetq.
Related Issues (20)
- Question about concurrency behaviour when consuming raw bytes using the Advanced API HOT 1
- upgrade dependency packages HOT 1
- EasyNetQ.Serialization.NewtonsoftJson.dll is automatically detected, but EasyNetQ.Serialization.SystemTextJson.dll is not HOT 2
- Connection doesn't seem to recover after specific BrokerUnreachableException HOT 2
- AlreadyClosedException
- Enable CA1852 diagnostic rule HOT 1
- How do I create a multi tenant base queue, pls need some help
- No 7.8.1 version in nuget.org HOT 3
- [Question] How to access IServiceResolver in 8.0.0 HOT 1
- EasyNetQ + Google.Protobuf HOT 1
- Only include STJ for net standard 2.0
- Package should be using a license expression
- Pubsub.PublishAsync inconsistent timeout behaviour when server is unreacheable
- Replace proprietary logging with Microsoft logging abstractions
- Replace DI container abstraction and packages with Microsoft abstractions
- System.OperationCanceledException HOT 1
- Cannot connect to RMQ after update to 7.8.0. HOT 4
- Central package management
- dispose cannot close the connection to rabbitMq
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easynetq.