Rebus | :bus: Simple and lean service bus implementation for NET | Messaging library
kandi X-RAY | Rebus Summary
kandi X-RAY | Rebus Summary
Latest stable: [NuGet stable] Current prerelease:
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 Rebus
Rebus Key Features
Rebus Examples and Code Snippets
Community Discussions
Trending Discussions on Rebus
QUESTION
With Pandas in Python there is the describe() function that returns the summary statistics for a dataframe. The output is not in a 'tidy' format for simple manipulation with the tidyverse summarise function but it is in a nice format for presentation. My question is how to reproduce this output in R?
...ANSWER
Answered 2022-Mar-12 at 07:11You can combine do.call()
with rind()
and lapply()
to get a tidy format of summary()
. t()
transpose the output.
QUESTION
Hello all (and most probably @mookid8000),
I am using Rebus C# library with Azure Storage queue. Everything works fine, just have one issue with logging.
Rebus is making several GetMessage calls to queue per second. That is extremely problematic, because it generates GB of data per day if "queue" operations are being logged to Log Analytics, which cost a lot money.
Is there a way to tell rebus to check the queue only each 10s, or each minute if last response return no new messages? My app doesn't need fast message handling, so slower refresh period between each call to queue is preferable anyway.
Maybe it can be configured somewhere here?
...ANSWER
Answered 2021-Dec-08 at 12:58You're looking for how to configure Rebus' back-off times 🙂
With it, you could do something like this
QUESTION
I have a Rebus bus setup with a single worker and max parallelism of 1 that processes messages "sequentialy". In case an handler fails, or for specific business reason, I'd like the bus instance to immediately stop processing messages.
I tried using the Rebus.Event package to detect the exception in the AfterMessageHandled handler and set the number of workers to 0, but it seems other messages are processed before it can actually succeed in stoping the single worker instance.
Where in the event processing pipeline could I do
bus.Advanced.Workers.SetNumberOfWorkers(0);
in order to prevent further message processing?
I also tried setting the number of workers to 0 inside a catch block in the handler itself, but it doesn't seem like the right place to do it since SetNumberOfWorkers(0)
waits for handlers to complete before returning and the caller is the handler... Looks like a some kind of a deadlock to me.
Thank you
...ANSWER
Answered 2021-Oct-29 at 07:10This particular situation is a little bit of a dilemma, because – as you've correctly observed – SetNumberOfWorkers
is a blocking function, which will wait until the desired number of threads has been reached.
In your case, since you're setting it to zero, it means your message handler needs to finish before the number of threads has reached zero... and then: 💣 ☠🔒
I'm sorry to say this, because I bet your desire to do this is because you're in a pickle somehow – but generally, I must say that wanting to process messages sequentually and in order with message queues is begging for trouble, because there are so many things that can lead to messages being reordered.
But, I think you can solve your problem by installing a transport decorator, which will bypass the real transport when toggled. If the decorator then returns null
from the Receive
method, it will trigger Rebus' built-in back-off strategy and start chilling (i.e. it will increase the waiting time between polling the transport).
Check this out – first, let's create a simple, thread-safe toggle:
QUESTION
I am in the process of writing some unit tests for my Rebus Handlers. I have opted to enable secondLevelRetriesEnabled
which results in an IFailed
being published when an exception is thrown in the Handler.
My Handler class definition is:
...ANSWER
Answered 2021-Oct-14 at 12:34I don't think there's a really elegant way at the moment, but one way that you could wrap up and maybe make pretty yourself, is to do something like this:
QUESTION
We have a .net core 3.1 web project running with Rebus and Azure Service Bus.
After updating to .NET 5 we can no longer send messages to the Azure Service Bus queue using Rebus. No code changes have been made, only update to .NET 5 and latest Rebus-packages(6.6.1).
...ANSWER
Answered 2021-Sep-17 at 09:25After updating Microsoft Azure packages to the latest version and switching the connections to the new DefaultAzureCredentials() for all azure services this resolved itself.
QUESTION
*Edit: Thanks to Martin and a little bit of time and attention, I was able to get the code where I needed it to be. Is it ugly? Yes, but it works in way that's useful to me now. Any tips on how to clean this up and make it more efficient would be super helpful.
Using the data frame trace_list
, I'm trying to append the values from Title
and Year
to the output of each list in the for loop. The following code opens each state's PDF link on page 10, pulls the city data (which ranges from 1-12 cities). Clean/tidies the data, and stores it in a list to be bound after data from each PDF is collected. Right now it only pulls the city name and a numerical value.
ANSWER
Answered 2021-Sep-06 at 18:00Since I can't run your code here a small suggestion for your code
QUESTION
I have strings from which I need to extract all matches from a vector using the rebus package.
...ANSWER
Answered 2021-Aug-30 at 04:00Pass the longer pattern first and then include the shorter ones.
QUESTION
I am trying to publish a message from the catch block in the Rebus message handlers without affecting the retry mechanism of rebus.
My intent is,
- Process the message in message handlers.
- In case of an error, catch it, and publish some error event using the same bus.
- Just after publishing "throw" the caught exception so that rebus ACK/NACK is placed automatically for the retry/re-delivery of the message.
I cannot achieve the above because if an exception is thrown from the rebus message handlers, that message is automatically flagged for re-delivery and the whole pipeline transaction is rolled back. This negates the second point above as when transaction is rolled back, the message I sent to be published is rolled back as well. Is there a way I could achieve this i.e. publishing the message as well as auto-retry ability. My message handler code is below.
...ANSWER
Answered 2021-Aug-12 at 12:12You can use Rebus' built-in "transaction scope suppressor" by creating a scope with it like this:
QUESTION
I have a class that I use as a message type in Rebus to publish/subscribe to, but I hit a snag when I was trying out a proof-of-concept in LinqPad. Any messages that my app receives fails with a deserialization exception. I have been able to narrow down the issue to Newtonsoft.JSON package and come up with the minimal example to demonstrate the issue:
...ANSWER
Answered 2021-Aug-02 at 02:58Most likely, there will be some static dictionary in the Newtonsoft.Json library that caches type information, keyed to strings such as "MyMessage". When you edit the query re-run it, LINQPad must re-compile the query, so there will be a new version of MyMessage
sitting in a new DLL. However, the static cache in Newtonsoft.Json will still point to the old one was used in the last execution.
To work around this, you don't need to re-start LINQPad; just press Shift+F5
to clear the cached process. Alternatively, add the following code to your query:
QUESTION
I know, that rebus stores errors across message deliveries in IErrorTraker (InMemErrorTracker). Is there any way to inject IErrorTraker to handlers or another way to get exception from previous attempt? Thanks!
...ANSWER
Answered 2021-Jul-14 at 10:01Yes there is, but you'll need to do some work yourself.
As you have correctly figured out, IErrorTracker
is what Rebus uses to keep track of failed delivery attempts, and so it would be able to provide information about previously recorded exceptions, given the ID if the message being handled.
It's internal to Rebus though, so it's not exposed in any way. You can get it out in a few different ways though, e.g. by having an incoming pipeline step put it into the incoming step context:
The way to do that (in a crude an unsophisticated way) can be seen here:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Rebus
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