RabbitMQ: None of the specified endpoints were reachable? - rabbitmq

Trying to publish a message to RabbitMQ using Masstransit but its failing.
I've looked at a few SO posts on this but none have a concrete answer. I've tried different ways of formatting the connection string, hard coding, etc but nothing seems to work.
If I connect outside of the app just via the browser, everything works fine.
In my app though, it just can't connect?
[09:09:46 WRN] Connection Failed: rabbitmq://{host}:15672/
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable
---> System.IO.IOException: connection.start was never received, likely due to a network timeout
I'm registering it like:
serviceCollection.AddMassTransit(x =>
{
x.UsingRabbitMq((rabbitContext, rabbitConfig) =>
{
rabbitConfig.Host(new Uri("amqps://{host}:15672/"), h =>
{
h.Username("admin");
h.Password("...");
});
rabbitConfig.ConfigureEndpoints(rabbitContext);
rabbitConfig.Durable = true;
});
});
If I just use the RabbitMQ library it also connects fine, so Masstransit seems to be the issue here?
/var/log/rabbitmq/rabbit#mg.log only logs failed connections via the management panel it seems, at least its not logging for failed app connects.

Check that you are using the right network port. Port 15672 is the default port for the web-based management console, which is not the same port MassTransit needs to connect to. That defaults to 5672 for plain AMQP, and 5671 for TLS-secured AMQP.
To confirm which ports your RabbitMQ server is listening on, and that your web server can access them see this troubleshooting guide and the answers to this question.

Related

EdgeX: Listen to IoT Messaging Bus from Redis Server

EdgeX uses Redis PubSub by default for its messaging bus (https://docs.edgexfoundry.org/2.3/microservices/application/Triggers/).
I have started the Redis server locally.
I have Core Data and/or Device Services running, which I believe is
also configured defaultly to use Redis Pub/Sub.
I have a Virtual Device Service that publishes data to the
edgex/events/# topic
(https://docs.edgexfoundry.org/2.3/microservices/device/virtual/Ch-VirtualDevice/).
Finally, I have configured my Application Service to subscribe to
the topic edgex/events/#, as shown in the example.
[Trigger.EdgexMessageBus]
Type = "redis" # message bus type (i.e "redis`, `mqtt` or `zero` for ZeroMQ)
[Trigger.EdgexMessageBus.SubscribeHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
SubscribeTopics="edgex/events/#"
[Trigger.EdgexMessageBus.PublishHost]
Host = "localhost"
Port = 6379
Protocol = "redis"
PublishTopic="" # optional if publishing response back to the MessageBus
The Application Service is able to recieve all the messages sent to the topic.
However, when I go directly to the redis server (using redis-cli) and subscribe to SUBSCRIBE edgex/events/# or any other variant (edgex/events,edgex), nothing appears. Even checking PUBSUB CHANNELS shows that there are no active channels.
I am assuming that since EdgeX is using my localhost redis server (or any remote server, for that matter), that I'd be able to directly check with that redis server, subscribe to the topic that EdgeX is publishing to, and see the same messages.
Am I missing anything?
Thanks!
The EdgeX implementation is using PSUBSCRIBE with wildcards; the only command that will give you visibility is PUBSUB NUMPAT. You will need to identify the correct pattern for what you are trying to subscribe to AND have your subscriber running before anything is published as Redis PubSub is fire/forget.
Rather than going directly to Redis, I recommend using the EdgeX Application Services to subscribe and then either operate on the results directly or feed that to an external service.

Connect to AMPQ RabbitMQ on port 5671

I am trying to connect to a RabbitMQ remote machine to read queue messages and currently I am using port 5672 which is sending the auth message over plain text so I need to get it working on port 5671 but it's failing.
Does it require anymore configuration then just changing the port number below?
I am using the nodeJS plugin for ampq-callback to connect
amqp.connect('amqp://xxx:5671', function(err,conn) {
https://www.rabbitmq.com/ssl.html
https://www.rabbitmq.com/troubleshooting-ssl.html
Yes, you must set up TLS in RabbitMQ.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Sockjs reconnect attempt does not subscribe to RabbitMQ queue

I am facing a weird problem with connecting Rabbitmq from UI. I use 'xhr-polling' only due to some reason to connect rabbitmq queue from UI and it works fine for quite sometime when user lands on page but it disconnects with rabbitmq at some point without any error.
I have put in some logic to reconnect, once it is disconnected and as per the log it seems it connects but when I look at the RabbitMQ there is no client connected to it. However browser console (connected to server RabbitMQ/3.6.10) and keeps sending calling xhr_send?t=[random-key] and xhr?=[random-key] gets response 204 or 200 (As per developer tool).
When I refresh the whole page, it connects back again fine and see rabbitmq client queue as well something like (connected to server RabbitMQ/3.6.10).
Technology stacks are : Sockjs + Stompjs + RabbitMQ with Stomp plugin
So in summary reconnect logic shows it is connected but as per rabbitmq there is no subscribed client. Normally I see something like this stomp-subscription-rIUXo4Yvmilga2w3g5Lu6g as queue name when connected.

Testing a websocket server with tsung

I start to use tsung to test my server with socket.io.
I downloaded the Github Zip, compiled and installed the latest "dev" including Websockets compatibility.
After browsing a lot of Google results and message in this mailing list, I couldn't find any answer to my issue. My problem is that I can't send/receive a message to my socket.io server. I'm able to connect to my socket with handshaking OK but nothing happens when I send the message. I tried to use bidir=true attribute but nothing change.
In my tsung log, I've got this messages:
=INFO REPORT==== 5-Sep-2013::08:08:00 ===
ts_client:(7:<0.93.0>) connect to port 80
=INFO REPORT==== 5-Sep-2013::08:08:00 ===
ts_client:(3:<0.93.0>) Data receive from socket in state think, stop
In my socket log (server side), I've got this messages:
debug: client authorized for
info: transport end (undefined)
debug: cleared heartbeat interval for client b07GKwmOJPQVDwznBzN1
debug: discarding transport
You can find my tsung.xml file here: http://pastebin.com/A60PpKrL
Please help,
Kind Regards,
Arnaud
try the 1.5.1 version as its "stable" and your using a bleeding edge build.
Also, try and tcpdump and tell me what you see, maybe use pastebin to show me the request.

How to debug ActiveMQ client?

I'm a fairly new user of ActiveMQ and I'm looking for a way to get detailed debug information on the client side of a queue connection. My problem is this: I have a server that is sending a message through a queue to a client. Using the admin web page associated with the broker, I can verify the following: the queue was created, there is a consumer associated with the queue, the message has been enqueued, the message has been dispatched, the dispatched queue size is 1, the message has not been dequeued. This setup was working yesterday but mysteriously stopped working today even though I did a restart of the activemq service. The log file at /var/log/activemq.log does not contain any useful information.
At this point I'm stumped; I'm assuming that there is some sort of problem with the configuration, but it hasn't changed since yesterday. Does anybody have a suggestion about what my next step should be?
Turn on debug (or even trace) logging in the broker first of all in conf/log4j.properties.
log4j.logger.org.apache.activemq=DEBUG
restart the broker and re-run your scenario. The logging will hopefully provide you with some information.
Jconsole is also a useful tool to monitor the running broker.
Does your client use any message filters?
You can also enable remote debugging and then connect with an IDE.
To start remote debugging execute
$ ACTIVEMQ_DEBUG=true bin/activemq
and then start a remote debugger to connect to port 5005