Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 20 04:18
    Build #3043 passed
  • Nov 20 02:39
    Build #3042 passed
  • Nov 20 01:54
    Build #3041 passed
  • Nov 20 00:29
    Build #3040 passed
  • Nov 19 22:24
    Build #3039 passed
  • Nov 19 20:41
    Build #3038 passed
  • Nov 19 14:52
    Build #3037 passed
  • Nov 19 14:26
    Build #3036 passed
  • Nov 17 19:12
    Build #3035 passed
  • Nov 17 18:40
    Build #3034 passed
  • Nov 17 14:01
    Build #3033 passed
  • Nov 16 21:10
    Build #3031 passed
  • Nov 16 18:09
    Build #3030 passed
  • Nov 13 17:17
    Build #3027 passed
  • Nov 10 18:19
    Build #3026 passed
  • Nov 09 17:24
    Build #3024 passed
  • Nov 09 17:03
    Build #3023 passed
  • Nov 07 03:23
    Build #3022 passed
  • Nov 06 17:26
    Build #3021 passed
  • Nov 04 20:18
    Build #3020 passed
Chris Patterson
@phatboyg
and you're configuring the consumer twice.
In your onConfigure method you should only have
config.UseMessageRetry(r => r.(policy choice here))
you should not configure the consumer
Ignore<T>() only says to ignore a specific exception, it doesn't specify the policy for the retry.
And if you dont' want to retry, dont' include use message retry at all
Also...
Just a reminder, this room is infrequently monitored, community support is on Discord: https://discord.gg/rNpQgYn
And SingleOrDefault will make it really slow. Use FirstOrDefault() instead.
Single() does a count, which means it waits to make sure no more messages are coming.
Harish Babu
@chekkan
thank you @phatboyg , changing from SingleOrDefault or FirstOrDefault fixed my issue :)
Omar Msaaf
@Omsaaf
Hi @phatboyg
We noticed a weird behaviour when it comes to retries, it's as if all retry information is within MT in-memory and not in the message it self
When a message is a poison pill which causes the consumers to crash, its retry attempts are never incremented. But If the code which hosts the consumers does not crash the retries are properly incremented
Is that the desired behaviour ?
Omar Msaaf
@Omsaaf
Forgot to specify I used MassTransit 6.2.1 and 6.3.2 and got the same behavior
Omar Msaaf
@Omsaaf
Another note : The messages that are retried have an encryption layer
Konstantin Ryazantsev
@KonstantinRyazantsev
Hi there. What is the best practice of replaying failed message from the error queues? Is there a ready to use tool, or an API in the library? Is there an example? I mean the case when a message is retried, redelivered and eventually end up in the error queue. Once the issue caused retries is fixed and the message in the error queue is reviewed, I want the message to be redelivered to the original queue. This should be triggered manually of course.
Chris Patterson
@phatboyg
@KonstantinRyazantsev depends upon the transport, most use Shovel with RabbitMQ. Not sure about the others.
Just a reminder, this room is infrequently monitored, community support is on Discord: https://discord.gg/rNpQgYn
Konstantin Ryazantsev
@KonstantinRyazantsev

@KonstantinRyazantsev depends upon the transport, most use Shovel with RabbitMQ. Not sure about the others.

thank you!

iamandymcinnes
@iamandymcinnes
Hi I've recently started seeing a problem in some of our Azure functions, where it complained there was no IErrorTransport available on the receive context (We were on version 6.0.1). I read the advice to update to 6.1 which I did. The error was then obfuscated as it them complained it couldn't find the messaging entity 'sb://qa-xxx.servicebus.windows.net/MassTransit/ReceiveFault'. Which is strange because the connection has full manage permission and previously the masstransit error topics have just been created automatically. So I manually create the topic and now I'm back to the IErrorTransport isn't available on the receive context. My code hasn't changed in over a year and they are very simple functions just reading a message and storing in SQL, Table or Blob storage.

Here is an example:
iamandymcinnes
@iamandymcinnes
public class DailyDemandEventFunction
{
    private readonly IDbFactory _dbFactory;

    public DailyDemandEventFunction(IDbFactory dbFactory)
    {
        _dbFactory = dbFactory;
    }

    [FunctionName("DailyDemandEventFunction")]
    public async Task Run([ServiceBusTrigger("%DailyDemandTopic%", "DailyDemandEventFunction", 
    Connection = "ServiceBusConnectionString")]Message message,
    IBinder binder, ILogger log, CancellationToken cancellationToken)
    {
        Log.Logger.Information("Received message: {@Message}", message);

        using (LogContext.PushProperty("Class", nameof(DailyDemandEventFunction)))
        using (LogContext.PushProperty("Method", nameof(Run)))
        using (Log.Logger.TimeOperation("{Class}.{Method}", nameof(DailyDemandEventFunction), nameof(Run)))
        {
            var handler = Bus.Factory.CreateBrokeredMessageReceiver(binder, cfg =>
            {
                cfg.CancellationToken = cancellationToken;
                cfg.Consumer(() => new DailyDemandEventConsumer(_dbFactory));
            });

            await handler.Handle(message);
        }
    }
}
iamandymcinnes
@iamandymcinnes
Additionally out of interest would I be able to have parts of my system running MassTransit 6.1 and other parts of the latest 7.x release. Just thinking if I'm going to have to update my functions I might as well start updating MassTransit there while I move them to version 3 of azure functions?
Xi Shen
@davidshen84
Hi, I am doing some unit test work with MassTransit . But I am still on MassTransit 5
When checking if a message is published, I could not find a way to access the message instance, only the message type instance.
How do I verify if a message with specific value has been published by some consumer?
Chris Patterson
@phatboyg
@davidshen84 you should be able to use harness.Published.Select<MyEvent>().First() to get the message
Just a reminder, this room is infrequently monitored, community support is on Discord: https://discord.gg/rNpQgYn
cartsp
@cartsp
Hi, I was working through the youtube tutorials from Chris, and tried doing it in .net5 and doing everything with docker compose. It all seems to be working fine, so I added the asp health checks with default settings and I am getting a false positive I believe "fail: Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService[103]
Health check IBus completed after 10.4365ms with status Unhealthy and description 'Not ready: not started'". Is there something I am missing?

code
public void ConfigureServices(IServiceCollection services)
{
services.AddHealthChecks();

        services.AddMassTransit(cfg => {
            cfg.AddRequestClient<SubmitOrder>();

            cfg.AddBus(provider => Bus.Factory.CreateUsingRabbitMq(cfg =>
            {
                cfg.Host("rabbitmq://rabbitmq");
            }));
        });

        services.AddMassTransitHostedService();

        services.AddControllers();
        services.AddSwaggerGen(c =>
        {
            c.SwaggerDoc("v1", new OpenApiInfo { Title = "MassTransitOrderSystem", Version = "v1" });
        });
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
            app.UseSwagger();
            app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "MassTransitOrderSystem v1"));
        }

        //app.UseHttpsRedirection();

        app.UseRouting();

        app.UseAuthorization();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapHealthChecks("/health");
            endpoints.MapControllers();
        });
    }
}

}

I tried using the controller and it worked and went back to the health check but still says unhealthy
Chris Patterson
@phatboyg
In your AddBus() you need .UseHealthCheck(provider) or just update to the new syntax with UsingRabbitMq
cartsp
@cartsp
Thanks a lot Chris will give it a go!
cartsp
@cartsp
worked a treat, cheers
Thom
@smileyiori
Hi guys, I am new here. I have a question. I need to get all users by one province. It will just return data for me. Should I use Request/Response on MassTransit or just use call my query directly into my controller? Why should I create a message to only return data?
Chris Patterson
@phatboyg
Just a reminder, this room is infrequently monitored, community support is on Discord: https://discord.gg/rNpQgYn
Marcos Lommez
@lommez
Hi, anyone of you have experienced the usage of scheduling with Quartz and Hangfire integration with Masstransit? Are there any advantages/disadvantages between them?
Vahid Akbari Rad
@vahidarr
Hi Friends, how can i create activity for courier that have ctor with parameter???!!!
actually, i want to inject my service in activity
Vahid Akbari Rad
@vahidarr
rabbitmq.ReceiveEndpoint("activity", _ => { var contractService = provider.GetRequiredService<ContractService>(); _.ExecuteActivityHost<ContractActivity, Contract>(new Uri("queue:activity_compensation"), ()=>new ContractActivity(contractService)); });
above code work but when i set service provider in second parameter instead factory method ,it doesnt work .why??
ronit rr
@ronit_cc_gitlab
Hi ...I am trying to consume a message response from Azure Service Bus through MassTransit....MassTransit sucessfully published the complex message. But It cannot de- serialize ..may be due to complexity of the message (Lists of abstract class)...as the message cannot be deserialized..I am planning to get the JSON payload of the message..I think MassTransit allways deserialze before sending any response to consumer..How to bypass the deserilization process and get the JSON payload from the service Bus topic using MassTransit? I have tried with JTOKEN but no luck..
Jeremy D. Miller
@jeremydmiller
Hey @phatboyg or anyone else, what facilities would MassTransit have for back pressure in a receiving endpoint?
Chris Patterson
@phatboyg
@jeremydmiller since messages are pushed from the broker to MT, the only real way to suspend a receive endpoint is to either stop the bus or use separately connected endpoints where you can disconnect an endpoint. The other option is to use a concurrencylimit filter that can be adjusted, but you can't go below 1 which would still allow traffic through the endpoint. Circuit breakers are there, but they end up cycling through message quickly due to instant exceptions and can put load directly into an error queue which requires triage back to the input queue. So there are options, each with different approaches to recovery after the backing service outage.
Andrii Davydenko
@garfieldua

Hi,

I am trying to perform several requests of the same message type in parallel using RequestClient. The request looks straight-forward:

var client = _busControl.CreateRequestClient<Request>(new Uri("rabbitmq://localhost/some-service"));
var response = await client.GetResponse<Response>(request);

The problem is that one of the requests is executed fine, but for another one "RequestTimeoutException: Timeout waiting for response" is being thrown.

I noticed that one temporary queue is used for both of the requests, and for the failed request the response appears in {tempQueueName_skipped} queue.

Am I doing something wrong here?

Gerard
@1304654_gitlab
Hello, first of all thanks for all people in this channel in special for PhatBoyG. Do you know how can I do integration test with MassTransit? I have a microservices architecture so when a UserEventWasCreated (after send by other handler and saved to db) I would like to checky in the database if user has been added. So in order to check this in my xUnit Test, I would need to wait until the UserEventWasCreated but can I do that? Some kind of timer? There are some method in order to wait for published message arrived? Do you have some example? Thanks!
pierre-seiitra
@pierre-seiitra
Hello :) I'm using MassTransit 6.3.2 with RabbitMq and i have a quick question : is there a way to specify the BrokerTopologyOptions (MaintainHierarchy/FlattenHierarchy) per message type ? After a quick look in the source code, it seems that we can only change it globally. Am i right ?
Chris Patterson
@phatboyg
@pierre-seiitra it can only be changed globally.
Just a reminder, this room is infrequently monitored, community support is on Discord: https://discord.gg/rNpQgYn
pierre-seiitra
@pierre-seiitra
Thanks for your confirmation :) Going to discord then
Fábio Tebaldi
@tebaldi

Hello, I´m using MassTransit 7.0.6 on a .net Core 3.1 app with health checks enabled via

services.AddMassTransitHostedService()

Currently I´m trying to implemente the Single Writer Principle in an specif endpoint on RabbitMq with the configuration:

IRabbitMqReceiveEndpointConfigurator rabbitConfig;
rabbitConfig.PrefetchCount = 1;
rabbitConfig.Exclusive = true;

This setup is working as intended, but when multiple instances of the app is running, the other instances acuses an Unhealthy status for the exclusive queues. There´s some way that I can prevent this behavior and make the other instances not become unhealthy?

Thanks in advance