NServiceBus | monitor better microservices with the most powerful service | Messaging library
kandi X-RAY | NServiceBus Summary
kandi X-RAY | NServiceBus Summary
NServiceBus is licensed under the RPL 1.5 license. More details can be found here.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NServiceBus
NServiceBus Key Features
NServiceBus Examples and Code Snippets
Community Discussions
Trending Discussions on NServiceBus
QUESTION
I want to be able to used NServiceBus to add a message on a queue in RabbitMQ. I dont want to handle it yet so just want to see an item on the queue, my code is as follows, but I get this error when I run it?
I have been trying to look at the documentation but is seems overly confusing. I am familar with RabbitMq and using it as is or with the Rabbit client library, but NService bus seems to complicate and confuse the situation!
...ANSWER
Answered 2022-Apr-01 at 20:44Your endpoint is publishing the message as well as receiving it. Since there's no handler defined to handle the UserChanged
messages (events), NServiceBus recoverability kicks in. Your options are
QUESTION
I'm building html tables where some of the can hold extremely long text. Can I wrap it like after 100 chars it has "..." and maybe on click it would reveal the whole text?
If possible I do like to keep this current style config and just add this feature.
...ANSWER
Answered 2022-Mar-22 at 06:51Yes, you can wrap the "super long text" inside a div then assign this styles to the div. white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow
QUESTION
I'm using NserviceBus with the Azure Function project ( NServiceBus.AzureFunctions.InProcess.ServiceBus
). Application is using azure service bus as the transport and it is configured in function startup by using the below code
ANSWER
Answered 2021-Dec-02 at 12:35As you are using the stable versions for your application like:
I would suggest to change the syntax and try based on connection string use cases:
To use Azure Service Bus as the underlying transport: Method 1:
If your connection string variable AzureServiceBusConnectionString
is present in the web config file, then try calling the connection string using the below code:
QUESTION
I have this App Service in Azure running as a Web Job. The application is a former Windows Service built using NServiceBus and I have been reconfiguring it to work in Azure.
The application is using AzureServiceBusTransport and I have my Azure Service Bus with a queue set up.
I got it working... when I am using a Shared Access Key configured in my connectionstring like this;
...ANSWER
Answered 2021-Nov-05 at 14:34Just ran into the same issue with NServiceBus. Instead of:
QUESTION
I have a sample solution with a console and library project. Both reference the same nuget but a different version. The console project also has a reference to the library project. So the structure is like this:
...ANSWER
Answered 2021-Nov-05 at 13:29It appears to be by design.
A little bit of searching, I found this: https://github.com/dotnet/fsharp/issues/3408#issuecomment-319466999
The coreclr will load an assembly of the version or higher than the reference. If the assembly discovered is lower than the reference then it fails.
Also this: https://github.com/dotnet/sdk/issues/384#issuecomment-260457776
downgrading the assembly version isn't supported on .NET Core
So, to confirm, I spent much more time than I intended looking/searching through https://github.com/dotnet/runtime. Eventually I found the assembly version compatibility method: https://github.com/dotnet/runtime/blob/172059af6623d04fa0468ec286ab2c240409abe3/src/coreclr/binder/assemblybindercommon.cpp#L49-L53
It checks all the components of the version separately, but if we look at just one, we can see what it's doing:
QUESTION
As per NServiceBus Azure Cosmos DB persistence documentation, the outbox deduplication data is kept for 7 days by default. However, this can easily add hundreds of outbox documents in a day for a high volume transaction DB. I understand we can change the default settings to reduce the outbox ttl
. However, before doing that, I would like to understand the following:
- What is the significance of keeping the outbox document for 7 days in Cosmos DB?
- What is the impact of reducing the
ttl
of the outbox document to, say, 4 days? Does it mean if a message has failed, it can be only recovered for the next 4 days? If yes, is there a way to clean up the outbox record for the transactions that are successful immediately?
ANSWER
Answered 2021-Aug-09 at 03:26What is the significance of keeping the outbox document for 7 days in Cosmos DB?
This is the default value. It's chosen to be on the safe side and ensure that no duplicates are reprocessed within 7 days, which is a fairly safe time range.
What is the impact of reducing the ttl of the outbox document to, say, 4 days?
If you reduce TTL to 4 days and there's a chance of a duplicate message arriving after that period, the duplicate will be processed rather than discarded.
Does it mean if a message has failed, it can be only recovered for the next 4 days?
The outbox feature is not about removing messages. It's used for de-duplication of the incoming messages to avoid unnecessary re-processing.
If yes, is there a way to clean up the outbox record for the transactions that are successful immediately?
You could set TTL to a very low value but then you're risking running into duplicate reprocessing as it's not about successful or unsuccessful incoming message processing but rather duplicates you cannot control. Not to mention that the outbox feature helps to reduce unnecessary handler execution upon incoming message retries in case dispatching has failed.
QUESTION
How can I send a message (or publish an event) when a message runs out of retries and moves to the error queue?
When a request comes into my system, I create a Saga to track it. The Saga sends commands to Handlers to do async work. If the handler fails, I want to both move that command to the error queue (the default behavior) and send a message to the Saga to alert the client that originally requested the work.
I have tried customizing the recoverability behavior to use the Saga as the error queue, which sends the command back but does not get it into the error queue:
...ANSWER
Answered 2021-Aug-02 at 17:52There's not an "easy" way to do that because at the moment when recoverability is happening, any transaction related to the incoming message (this is different for each transport) is in doubt, so you can't really do anything else within the scope of what's going on right at that moment.
Once you start your endpoint, you can cast the IEndpointInstance
to an IMessageSession
(same thing without things like the Stop method) and then assign that to a place where your "error queue notifier" will be able to find it. Then any operation you do with the IMessageSession
will basically be a separate context, disconnected from the processing of the incoming message.
Just understand that if the message is failing processing because of an underlying problem with the queue, that's not going to report correctly. That's why most people would be doing some sort of call to a reporting/diagnostics service in those callbacks.
QUESTION
I'm trying to build my first NserviceBus application, but I cannot get it to work. The message arrives on the "backend" but the handler uses DI and NServicebus claims it cannot find the service for the interface. But the code was lifted directly from the examples. I'm missing something and I cannot figure it out.
The Error: dbug: NServiceBus.LoadHandlersConnector[0] Processing message type: Messages.JobStartCommand Message headers: NServiceBus.MessageId : 0044f261-e3b3-4287-b6f0-ad7400ef43cb NServiceBus.MessageIntent : Send NServiceBus.ConversationId : bb4f276f-63fe-450b-b234-ad7400ef43cd NServiceBus.CorrelationId : 0044f261-e3b3-4287-b6f0-ad7400ef43cb NServiceBus.ReplyToAddress : ClientUI NServiceBus.OriginatingMachine : L19002992 NServiceBus.OriginatingEndpoint : ClientUI $.diagnostics.originating.hostid : e1fecb2b72b8185e47341bb4dfb37dd7 NServiceBus.ContentType : text/xml NServiceBus.EnclosedMessageTypes : Messages.JobStartCommand, Messages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null NServiceBus.Version : 7.5.0 NServiceBus.TimeSent : 2021-07-29 14:31:08:228497 Z NServiceBus.Retries : 3 NServiceBus.Retries.Timestamp : 2021-07-29 14:31:40:397277 Z Handlers to invoke: Extractor.JobStartHandler Extractor.JobStartHandler info: NServiceBus.RecoverabilityExecutor[0] Immediate Retry is going to retry message '0044f261-e3b3-4287-b6f0-ad7400ef43cb' because of an exception: System.InvalidOperationException: Unable to resolve service for type 'IExtract' while attempting to activate 'Extractor.JobStartHandler'. at Microsoft.Extensi
My backend program.cs
...ANSWER
Answered 2021-Jul-30 at 13:00I cleaned out the offending interface from the code and still got the error on an interface that was not even there anymore. I removed the bin folder and build everything back up step by step. Stupid thing is, source control says I am back where I started, without changes. And it just works....
So must have bin something stupid with VS2019. Sorry to anyone who's time I wasted
QUESTION
I have an Azure function and I'm trying to send a message with NServiceBus using Azure ServiceBus transport.
I have successfully got it working following this doc when the endpoint name does not have a “.” or period in the name. E.g.: ASBTriggerQueue
However, my endpoint name has a period, “.” and I do not have control to change the endpoint name.
With period in the name I get the following error:
The ‘NServiceBusFunctionEndpointTrigger-asb.triggerqueue’ function is in error: ‘NServiceBusFunctionEndpointTrigger-a sb.triggerqueue’ is not a valid function name.
Is anyone aware of workarounds to fix this issue?
...ANSWER
Answered 2021-Jul-16 at 23:48The problem is with the trigger function name. Functions doesn't like dots in it. With release 1.2.0 of NServiceBus.AzureFunctions.InProcess.ServiceBus
you can override trigger function name. See documentation for details
QUESTION
I'm using NServiceBus with SQL Persistance and MSSQL Server.
I want to be sure that I don't get invalid data in my database in high concurrent scenarios.
From the docs I know that the SQL persister uses pessimistic concurrency since version 4.1.1. But I'm not sure how it works exactly because under "Starting Saga" and "Changes to Saga state" only optimistic concurrency is mentioned.
Does each saga instance only handle one message at a time and all the remaining messages are waiting in the queue to be handled by the saga?
Also is it possible to configure the concurrency to use optimistic concurrency instead of pessimistic concurrency for the SQL persister?
...ANSWER
Answered 2021-Jun-01 at 07:03Both optimistic concurrency control and pessimistic locking result in a saga instance to only being able to handle 1 message.
Might multiple messages be handled then with :
Optimistic concurrency control: The 2nd+ writer will fail and the message will be retried.
Locking: THe lock ensures that multiple messages on the same saga instance will be delayed. Sometimes this can result in a deadlock due to lock escalation and then the message will be retried.
Regarding pessimisitic vs optimistic, you cannot choose. The latest version uses pessimistic locking. See https://docs.particular.net/persistence/sql/saga-concurrency:
Starting in version 4.1.1 conflicts cannot occur because the persistence uses pessimistic locking. Pessimistic locking is achieved by performing a SELECT ... FOR UPDATE or its dialect-specific equivalent.
Up to and including version 4.1, SQL persistence uses optimistic concurrency control when updating or deleting saga data.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NServiceBus
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page