You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by thejeed <de...@jeed.de> on 2015/07/25 11:29:42 UTC

Receiving messages in a topic works local, but not remote

Hi @ll,

I'm David, newbie to ActiveMQ. I'm using v5.11.1 as an embedded broker.

What I want to do is to produce a message and deliver it using a topic. On
the other side of the line, a client program establishes a connection to the
broker, creates a TopicSubscriber and reacts via a MessageListener on
incoming messages. So far, so good.

Now, this all works as expected when server and client are running locally
on the same system. As soon as I upload the broker to my server and start
it, a connection seems to be established, but the MessageListener isn't
executed anymore.

Maybe it's a problem with the way I configure the broker? Here's how I do
it:



I'd be really glad for any advice on how to solve the problem or how to
debug it.

Kind regards,

David



--
View this message in context: http://activemq.2283324.n4.nabble.com/Receiving-messages-in-a-topic-works-local-but-not-remote-tp4699825.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Receiving messages in a topic works local, but not remote

Posted by thejeed <de...@jeed.de>.
Thanks a lot, Tim & Chris - almost at the same moment your answers
arrived, I've read about the start() - call on the connection in the
docs - that has been my problem. Now, everything's runnig fine. Also,
I'm glad to receive some advise on how to debug the broker - I guess
that will be useful knowledge in the future...

Am 25.07.2015 um 17:00 schrieb Tim Bain [via ActiveMQ]:
> And have you confirmed that you updated the URI the client uses so it
> refers to the new non-local host?  It's a basic thing, but could be
> easy to
> forget.
>
> If you haven't already, enable JMX for your broker.  It'll let you see
> which clients are successfully connected, how many messages are
> pending for
> them, etc.  It's very useful for troubleshooting.
>
> Tim
> On Jul 25, 2015 7:18 AM, "Christopher Shannon" <
> [hidden email] </user/SendEmail.jtp?type=node&node=4699834&i=0>> wrote:
>
> > First, with your clients, did you call start on the connection?  It's a
> > common mistake and easy forget to do but I'm guessing you did that
> since it
> > worked with an embedded broker.
> >
> > Second, are you connecting with your MessageListener before
> publishing your
> > messages or after? Your message consumer won't receive messages
> published
> > before it connected unless there is a durable subscription set up.
> >
> > Third, for debugging, you can try increasing the logging to debug to
> see
> > exactly what is going on.
> > http://activemq.apache.org/how-do-i-change-the-logging.html  This
> should
> > give you information on connections established and where messages are
> > going.  Also, you can try using JMX to see what the state of the
> broker is.
> > That might give you some useful information to help debug this.
> > http://activemq.apache.org/jmx.html .
> >
> > If the above things don't help, can you post your broker config
> and/or your
> > client code for the publisher and consumer?
> >
> > -Chris
> >
> > On Sat, Jul 25, 2015 at 5:29 AM, thejeed <[hidden email]
> </user/SendEmail.jtp?type=node&node=4699834&i=1>> wrote:
> >
> > > Hi @ll,
> > >
> > > I'm David, newbie to ActiveMQ. I'm using v5.11.1 as an embedded
> broker.
> > >
> > > What I want to do is to produce a message and deliver it using a
> topic.
> > On
> > > the other side of the line, a client program establishes a
> connection to
> > > the
> > > broker, creates a TopicSubscriber and reacts via a MessageListener on
> > > incoming messages. So far, so good.
> > >
> > > Now, this all works as expected when server and client are running
> > locally
> > > on the same system. As soon as I upload the broker to my server
> and start
> > > it, a connection seems to be established, but the MessageListener
> isn't
> > > executed anymore.
> > >
> > > Maybe it's a problem with the way I configure the broker? Here's
> how I do
> > > it:
> > >
> > >
> > >
> > > I'd be really glad for any advice on how to solve the problem or
> how to
> > > debug it.
> > >
> > > Kind regards,
> > >
> > > David
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://activemq.2283324.n4.nabble.com/Receiving-messages-in-a-topic-works-local-but-not-remote-tp4699825.html
> > > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> > >
> >
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://activemq.2283324.n4.nabble.com/Receiving-messages-in-a-topic-works-local-but-not-remote-tp4699825p4699834.html
>
> To unsubscribe from Receiving messages in a topic works local, but not
> remote, click here
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4699825&code=ZGV2QGplZWQuZGV8NDY5OTgyNXwtMTkwMjM0OTg3MA==>.
> NAML
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>





--
View this message in context: http://activemq.2283324.n4.nabble.com/Receiving-messages-in-a-topic-works-local-but-not-remote-tp4699825p4699904.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Receiving messages in a topic works local, but not remote

Posted by Tim Bain <tb...@alumni.duke.edu>.
And have you confirmed that you updated the URI the client uses so it
refers to the new non-local host?  It's a basic thing, but could be easy to
forget.

If you haven't already, enable JMX for your broker.  It'll let you see
which clients are successfully connected, how many messages are pending for
them, etc.  It's very useful for troubleshooting.

Tim
On Jul 25, 2015 7:18 AM, "Christopher Shannon" <
christopher.l.shannon@gmail.com> wrote:

> First, with your clients, did you call start on the connection?  It's a
> common mistake and easy forget to do but I'm guessing you did that since it
> worked with an embedded broker.
>
> Second, are you connecting with your MessageListener before publishing your
> messages or after? Your message consumer won't receive messages published
> before it connected unless there is a durable subscription set up.
>
> Third, for debugging, you can try increasing the logging to debug to see
> exactly what is going on.
> http://activemq.apache.org/how-do-i-change-the-logging.html  This should
> give you information on connections established and where messages are
> going.  Also, you can try using JMX to see what the state of the broker is.
> That might give you some useful information to help debug this.
> http://activemq.apache.org/jmx.html .
>
> If the above things don't help, can you post your broker config and/or your
> client code for the publisher and consumer?
>
> -Chris
>
> On Sat, Jul 25, 2015 at 5:29 AM, thejeed <de...@jeed.de> wrote:
>
> > Hi @ll,
> >
> > I'm David, newbie to ActiveMQ. I'm using v5.11.1 as an embedded broker.
> >
> > What I want to do is to produce a message and deliver it using a topic.
> On
> > the other side of the line, a client program establishes a connection to
> > the
> > broker, creates a TopicSubscriber and reacts via a MessageListener on
> > incoming messages. So far, so good.
> >
> > Now, this all works as expected when server and client are running
> locally
> > on the same system. As soon as I upload the broker to my server and start
> > it, a connection seems to be established, but the MessageListener isn't
> > executed anymore.
> >
> > Maybe it's a problem with the way I configure the broker? Here's how I do
> > it:
> >
> >
> >
> > I'd be really glad for any advice on how to solve the problem or how to
> > debug it.
> >
> > Kind regards,
> >
> > David
> >
> >
> >
> > --
> > View this message in context:
> >
> http://activemq.2283324.n4.nabble.com/Receiving-messages-in-a-topic-works-local-but-not-remote-tp4699825.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>

Re: Receiving messages in a topic works local, but not remote

Posted by Christopher Shannon <ch...@gmail.com>.
First, with your clients, did you call start on the connection?  It's a
common mistake and easy forget to do but I'm guessing you did that since it
worked with an embedded broker.

Second, are you connecting with your MessageListener before publishing your
messages or after? Your message consumer won't receive messages published
before it connected unless there is a durable subscription set up.

Third, for debugging, you can try increasing the logging to debug to see
exactly what is going on.
http://activemq.apache.org/how-do-i-change-the-logging.html  This should
give you information on connections established and where messages are
going.  Also, you can try using JMX to see what the state of the broker is.
That might give you some useful information to help debug this.
http://activemq.apache.org/jmx.html .

If the above things don't help, can you post your broker config and/or your
client code for the publisher and consumer?

-Chris

On Sat, Jul 25, 2015 at 5:29 AM, thejeed <de...@jeed.de> wrote:

> Hi @ll,
>
> I'm David, newbie to ActiveMQ. I'm using v5.11.1 as an embedded broker.
>
> What I want to do is to produce a message and deliver it using a topic. On
> the other side of the line, a client program establishes a connection to
> the
> broker, creates a TopicSubscriber and reacts via a MessageListener on
> incoming messages. So far, so good.
>
> Now, this all works as expected when server and client are running locally
> on the same system. As soon as I upload the broker to my server and start
> it, a connection seems to be established, but the MessageListener isn't
> executed anymore.
>
> Maybe it's a problem with the way I configure the broker? Here's how I do
> it:
>
>
>
> I'd be really glad for any advice on how to solve the problem or how to
> debug it.
>
> Kind regards,
>
> David
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Receiving-messages-in-a-topic-works-local-but-not-remote-tp4699825.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>