Using rabbit from lisp inside docker

25 views
Skip to first unread message

Troy Daniels

unread,
Oct 2, 2015, 4:59:49 PM10/2/15
to rabbitm...@googlegroups.com
Hello,

I am having trouble accessing rabbitMQ from lisp when I run inside a Docker container.  There are many details at http://stackoverflow.com/questions/32897952/sending-messages-to-rabbit-mq-using-lisp-inside-a-docker-container.  Does anyone have useful insights about what might be going wrong there?

Also, is it generally better to post such questions here or on stack overflow?  There is a RabbitMQ tag on SO, so that seems plausible, but there seems to be more answers here.  OTOH, it is not clear to me if this is a Rabbit issue or a Docker issue (probably not an SBCL issue), so SO would let Docker experts see it as well.

Troy

Michael Klishin

unread,
Oct 2, 2015, 5:14:58 PM10/2/15
to rabbitm...@googlegroups.com
What is in RabbitMQ logs around the time you try to connect? What client is used? Can you post your code (preferably as a gist)?
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Troy Daniels

unread,
Oct 2, 2015, 5:58:08 PM10/2/15
to rabbitm...@googlegroups.com
The client is cl-rabbit from https://github.com/lokedhs/cl-rabbit, linked from the rabbitmq web page.  The lisp code (except for the cl-rabbit client) is in the SO question.  The full broker log is below.

I’m about to leave for he weekend.  I’ll create a gist on Monday if this isn’t enough information.  

Troy

msgbroker_1 | 

msgbroker_1 |               RabbitMQ 3.5.5. Copyright (C) 2007-2015 Pivotal Software, Inc.

msgbroker_1 |   ##  ##      Licensed under the MPL.  See http://www.rabbitmq.com/

msgbroker_1 |   ##  ##

msgbroker_1 |   ##########  Logs: tty

msgbroker_1 |   ######  ##        tty

msgbroker_1 |   ##########

msgbroker_1 |               Starting broker...

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Starting RabbitMQ 3.5.5 on Erlang 18.1

msgbroker_1 | Copyright (C) 2007-2015 Pivotal Software, Inc.

msgbroker_1 | Licensed under the MPL.  See http://www.rabbitmq.com/

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | node           : rabbit@4733860cfe10

msgbroker_1 | home dir       : /var/lib/rabbitmq

msgbroker_1 | config file(s) : /etc/rabbitmq/rabbitmq.config

msgbroker_1 | cookie hash    : Aq4L6k0WNrBLgQdNIlexIw==

msgbroker_1 | log            : tty

msgbroker_1 | sasl log       : tty

msgbroker_1 | database dir   : /var/lib/rabbitmq/mnesia/rabbit@4733860cfe10

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Memory limit set to 801MB of 2002MB total.

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Disk free limit set to 50MB

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Limiting to approx 1048476 file handles (943626 sockets)

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | FHC read buffering:  ON

msgbroker_1 | FHC write buffering: ON

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 |     application: mnesia

msgbroker_1 |     exited: stopped

msgbroker_1 |     type: temporary

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Priority queues enabled, real BQ is rabbit_variable_queue

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Adding vhost '/'

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Creating user 'guest'

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Setting user tags for user 'guest' to [administrator]

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Setting permissions for 'guest' in '/' to '.*', '.*', '.*'

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | msg_store_transient: using rabbit_msg_store_ets_index to provide index

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | msg_store_persistent: using rabbit_msg_store_ets_index to provide index

msgbroker_1 | 

msgbroker_1 | =WARNING REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | msg_store_persistent: rebuilding indices from scratch

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | started TCP Listener on [::]:5672

msgbroker_1 |  completed with 0 plugins.

msgbroker_1 | 

msgbroker_1 | =INFO REPORT==== 2-Oct-2015::21:51:40 ===

msgbroker_1 | Server startup complete; 0 plugins started.

Michael Klishin

unread,
Oct 2, 2015, 6:39:51 PM10/2/15
to rabbitm...@googlegroups.com
There are no inbound connections logged by the server. Are you sure that TCP connections on RabbitMQ ports are allowed?

> On 3 oct 2015, at 1:58, Troy Daniels <troy.d...@stresearch.com> wrote:
>
> The

Troy Daniels

unread,
Oct 5, 2015, 10:35:38 AM10/5/15
to rabbitm...@googlegroups.com
Using a different configuration with the same broker but a Java client,
messages are sent and received.

Troy

On 10/2/15, 6:39 PM, "rabbitm...@googlegroups.com on behalf of Michael
Klishin" <rabbitm...@googlegroups.com on behalf of
>--
>You received this message because you are subscribed to the Google Groups
>"rabbitmq-users" group.
>To unsubscribe from this group and stop receiving emails from it, send an
>email to rabbitmq-user...@googlegroups.com.
>To post to this group, send an email to rabbitm...@googlegroups.com.

Alvaro Videla

unread,
Oct 5, 2015, 10:39:19 AM10/5/15
to rabbitm...@googlegroups.com, Troy Daniels
On 5 October 2015 at 16:35:37, Troy Daniels (troy.d...@stresearch.com) wrote:
Using a different configuration with the same broker but a Java client, 
messages are sent and received. 

And what’s different in that 'different configuration’?

Alvaro Videla

unread,
Oct 5, 2015, 11:08:17 AM10/5/15
to Troy Daniels, rabbitm...@googlegroups.com
Please keep rabbitmq-users CC'ed

Is you Java app running on the same box as "msgbroker", but your LISP client running somewhere else? The guest user can't connect from a remote node: https://www.rabbitmq.com/access-control.html

You RabbitMQ logs should tell you about failed connection attempts. If there's nothing there, chances are your LISP client is not reaching the broker. 

As a last resort, try using something like wireshark and see what's going on.

On Mon, Oct 5, 2015 at 5:01 PM, Troy Daniels <troy.d...@stresearch.com> wrote:
Pretty much everything on the client side and nothing on the same side.  In the working one, we launch a JVM and call

        duration = new FiniteDuration(30, TimeUnit.MINUTES);

        Address msgbrokerAddr = new Address("msgbroker", 5672);

        List<Address> addrs = Lists.newArrayList(msgbrokerAddr);

        ConnectionSettings settings = new ConnectionSettings(JavaConversions.asScalaBuffer(addrs).toList(),
                                                              "/", // virtualHost
                                                              "guest", // username
                                                              "guest", // password
                                                              Option.empty(), // heartbeat
                                                              Duration.Inf(), // timeout
                                                              false, // AutoRecovery
                                                              duration, // recoveryInterval
                                                              Option.empty() // no options
                                                              );
        connection = Connection$.MODULE$.apply(settings);

Using the classes from io.scala.  Relevant part of the pom.xml:

        <!-- RabbitMQ interface -->
        <dependency>
          <groupId>io.scalac</groupId>
          <artifactId>reactive-rabbit_2.11</artifactId>
          <version>1.0.2</version>
        </dependency>


With the non-working version, we start SBCL, load cl-rabbit and call

(defvar msgbroker "msgbroker")

  (with-connection (conn)
    (format t "Created connection ~s~%" conn)
    (let ((socket (tcp-socket-new conn))
          (channel 1))
      (format t "Created socket ~s~%" socket)
      (socket-open socket msgbroker 5672)
      (format t "Opened socket ~s~%" socket)
      (login-sasl-plain conn "/" "guest" "guest")
      (format t "logged in ~s~%" conn)
)

In both cases, we try to connect to host msgbroker with username guest and password guest.  In one case, it works.  In the other, there is a memory fault.

Troy

From: Alvaro Videla <videl...@gmail.com>
Date: Monday, October 5, 2015 at 10:39 AM
To: "rabbitm...@googlegroups.com" <rabbitm...@googlegroups.com>, Daniels Troy <troy.d...@stresearch.com>
Subject: Re: [rabbitmq-users] Using rabbit from lisp inside docker
Reply all
Reply to author
Forward
0 new messages