4 Replies Latest reply on Jan 29, 2016 2:43 PM by James Murtaugh

    Remote MDB consumer for a Topic not receiving messages

    James Murtaugh Newbie

      I have two EAP applications currently running on the same server but eventually will be running on separate servers.  I am trying to configure a remote JMS topic so that the first application can produce and consume the message on the topic and the second application can also consume the message.  On the first application, I produce the message and consume it as expected.  On the second application server I see this in the log:

      2016/01/26-19:17:30,768 DEBUG [org.hornetq.core.server] (Thread-6 (HornetQ-remoting-threads-HornetQServerImpl::serverUUID=e50632ef-bfe6-11e5-8e8f-9d0247392d58-1654107063-896425179)) Message ServerMessage[messageID=2147567328,userID=null,priority=0, bodySize=512,expiration=0, durable=true, address=hornetq.notifications,properties=TypedProperties[{_HQ_NotifType=CONSUMER_CREATED, _HQ_RemoteAddress=invm:0, _HQ_NotifTimestamp=1453835850768, _HQ_Address=jms.topic.AcanoCdrTopic, _HQ_RoutingName=acanoCdrClient.acanoCdrSubscription, _HQ_Distance=0, _HQ_ConsumerCount=15, _HQ_ClusterName=acanoCdrClient.acanoCdrSubscriptione50632ef-bfe6-11e5-8e8f-9d0247392d58, _HQ_User=jcmuser, _HQ_SessionName=71f8c9fc-c461-11e5-ab52-edef1e489ace}]]@789691335 is not going anywhere as it didn't have a binding on address:hornetq.notification.  So I beleve that the message is getting to the second application, but for some reason the MDB on that application is not seeing the notification.  I have attached the remote MDB, the domain.xml, and the logs from both the producer application and the receiving application. 

       

      I assume I am missing some configuration that binds the MDB to the the notification, but don't know what that might be.

       

      Thanks,

      Jim

        • 1. Re: Remote MDB consumer for a Topic not receiving messages
          Justin Bertram Master

          The DEBUG log message you pasted in your comment has nothing to do with the message your application is sending.  It's regarding a HornetQ management notification message to alert any interested party of particular events.  In this case, the message is about the creation of a consumer on the "AcanoCdrTopic" topic.  The message is sent to the "hornetq.notifications" address (just like all notification messages by default).  However, there are no bindings on that address so the message is discarded.  If you configure your MDB to listen on the notifications address then your MDB will get notifications, but it won't get the actual messages that you ostensibly want.  I don't think this DEBUG log message is particularly germane to your issue so we can set it aside.

           

          Looking at your configuration I can't tell what the intent is.  It's a bit of a mess.  Here are a few observations...

          • The "netty-remote-node-a" and "server-1-connector" connectors are functionally equivalent and therefore redundant.  As far as I can tell there's no need to have them both configured.  The same goes for "netty-remote-node-b" and "server-2-connector."
          • You've configured the servers in this domain to be clustered but you've also got a pooled-connection-factory that is potentially connecting to some of the same remote servers.  This is a bit schizophrenic.  You need to choose one configuration or the other.  If brokers are clustered then messages sent to a topic on one broker are automatically distributed to the other nodes in the cluster with that topic.  Therefore, in a clustered configuration there's no need to explicitly connect to the other remote nodes in the cluster (as you've done with your "hornetq-remote-ra" pooled-connection-factory).  If you want to keep your "hornetq-remote-ra" pooled-connection-factory then I recommend that you disable clustering and also remove the "in-vm" connector-ref.

           

          Once you get your configuration sorted out let me know if you're still having problems receiving messages.

          • 2. Re: Remote MDB consumer for a Topic not receiving messages
            James Murtaugh Newbie

            Justin,

            Thanks for the input, it was schizophrenic, I was trying to simulate separate applications on separate servers on a single server.  I am reconfiguring my lab so that I will have the application that produces the topic message is on a separate server. I will let you know how that goes.   I have a question, I read an article, Messaging configuration - JBoss AS 7.1 - Project Documentation Editor, that says that pooled connections cannot be used for remote clients.   It is dated 2012 so am unsure if that is still true.

            Thanks,

            Jim

            • 3. Re: Remote MDB consumer for a Topic not receiving messages
              Justin Bertram Master

              The documentation you linked is accurate.  To be clear, it says that a pooled-connection-factory "...is only available to local clients, although it can be configured to point to a remote server."  JCA-based connection factories like the pooled-connection-factory have never been usable from remote clients and I don't think that will change.

              • 4. Re: Remote MDB consumer for a Topic not receiving messages
                James Murtaugh Newbie

                Justin,

                Thanks for you insights.  I separated things out put my remote event server on a remote server and fixed the configuration files appropriately and it worked.

                 

                Jim