Is there a way that MassTransit can publish directly to a queue without a consumer?

2,875 views
Skip to first unread message

mary w

unread,
Apr 27, 2016, 12:09:07 PM4/27/16
to masstransit-discuss
so, using mass transit over rabbit mq is decent while communicating through internal systems, but, when it comes time to publish to a third party that we do not want to share contracts or assemblies with, or maybe they do not use .net but they want to read from a rabbitmq queue that we have setup for them, we could not find a way (easy one at least, we found couple of hacks) for us to publish to a queue name through mass transit without any consumers.
is there a reason why there isn't a feature like this or an override or...?

Sudhanshu Mishra

unread,
Apr 28, 2016, 1:55:28 AM4/28/16
to masstransit-discuss
Wouldn't an API that the 3rd part can call with something like SignalR be better suited than exposing a queue? 

mary w

unread,
Apr 29, 2016, 12:39:08 PM4/29/16
to masstransit-discuss
SignalR would work as an alternative, have just an api would work, i mean there are a lot of solutions, we can always write to the rabbitmq directly using the rabbitmq client as well.
but we do want multiple subscribers, we do want persistent queues for retries. the reason why i was asking is, it would be nice if through MT, there would be functionality to not wait for a consumer and specify the destination whether a consumer exists or not. current state, a publish does not really publish unless someone is interested.. 
what i am referring to is a bit more similar to NServiceBus functionality.
have you implemented anything of the sort using MT?
thank you for your help

Keith Higbee

unread,
Aug 7, 2019, 3:42:04 PM8/7/19
to masstransit-discuss
Hi Mary,

I'm looking to do the same with MassTransit. I want to send messages to a queue which is then consumed by downstream processes outside of .Net.

I used to do the same with NServiceBus, but can't figure out how to pull it off in MT thus far.

Eric Piraux

unread,
Aug 8, 2019, 1:58:02 AM8/8/19
to masstrans...@googlegroups.com
Hello,

You can use the GetSendEndpoint(...) from the context (or from the buscontrol, but prefer the message context when possible).

Look in the ConfigureBus() method, where an instance of IBusControl is created and where a sendEndPoint is created (line 90)

Hope it helps.

Eric


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/cdeb3d29-202c-4979-8c7d-a938f24d50e4%40googlegroups.com.

Higbee, Keith

unread,
Aug 8, 2019, 10:16:33 AM8/8/19
to masstrans...@googlegroups.com
Thanks Eric, that gets me a bit further. 

I'm getting the following when trying to Send to the SQS queue.

```
Inner Exception 1:
EndpointNotFoundException: The host was not found for the specified address: https://sqs.us-west-2.amazonaws.com/#######/send_only
```
The code making the call look like:

```
Message msg = new Message();
msg.Data = vehicleDto.Vin;

_sendEndpointTask = _bus.GetSendEndpoint(new Uri("https://sqs.us-west-2.amazonaws.com/#######/send_only"));
_sendEndpointTask.Result.Send(msg);
```



Higbee, Keith

unread,
Aug 8, 2019, 10:26:49 AM8/8/19
to masstrans...@googlegroups.com
Adding on some context here:

I'm really wanting to use MassTransit to Publish events to an SNS topic for fanout to non-.Net systems. Any examples on how to wire that up would be greatly appreciated.
Reply all
Reply to author
Forward
0 new messages