You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jacek Serafiński <ja...@gmail.com> on 2010/03/19 12:20:56 UTC

Newbie problem with AJAX

Hi everyone,

I have a newbie problem with ActiveMQ.
I'm trying to make a web app which will get messages using AJAX from a
different machine.

Imagine:
2 machines with ActiveMQ onboard.

First runs a test webapp - portfolio data publisher

On the second machine I run app - portfolio (it get messages from portfolio
data publisher - default from the same machine)
I would like him to get the messages from the other machine (connect to his
ActiveMQ) - how can I do that?

The problem should be easy -
In the file webapps\demo\WEB-INF\web.xml Change from :
<param-name>org.apache.activemq.brokerURL</param-name>
        <param-value>vm://localhost</param-value>
to
<param-name>org.apache.activemq.brokerURL</param-name>
        <param-value>vm://other_server_ip</param-value>"

but it does not work or I'm doing it wrong.

Can anyone help with that?

Thanks,
Jacek

Re: Newbie problem with AJAX

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

I tried a similar thing. Started a standalone ActiveMQ instance and ran
activemq-web-demo using

mvn jetty:run

and pointing it to tcp://localhost:61616, which basically simulates your
setup running demo and the broker in two virtual machines.

Everything works as expected.

Can you try running portfolio data publisher from the second machine as well
and see if it reports some errors. maybe there's a communication problem
between two machines. Also, be sure that second machine must have all Ajax
stuff configured properly as your web page must communicate with Ajax
servlet on that machine, which will consume messages from a broker (wherever
that broker is).

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


2010/3/22 Jacek Serafiński <ja...@gmail.com>

> Well,
>
> I don't see any errors - and I don't see these messages.
> You can try it by yourself with 2 machines using built-in example
> (portfolio).
>
> Cheers,
> Jacek
>
> On Fri, Mar 19, 2010 at 1:26 PM, Dejan Bosanac <de...@nighttale.net>
> wrote:
>
> > Hi,
> >
> > that should do the trick. What errors are you seeing?
> >
> > Cheers
> > --
> > Dejan Bosanac - http://twitter.com/dejanb
> >
> > Open Source Integration - http://fusesource.com/
> > ActiveMQ in Action - http://www.manning.com/snyder/
> > Blog - http://www.nighttale.net
> >
> >
> > 2010/3/19 Jacek Serafiński <ja...@gmail.com>
> >
> > > Hi everyone,
> > >
> > > I have a newbie problem with ActiveMQ.
> > > I'm trying to make a web app which will get messages using AJAX from a
> > > different machine.
> > >
> > > Imagine:
> > > 2 machines with ActiveMQ onboard.
> > >
> > > First runs a test webapp - portfolio data publisher
> > >
> > > On the second machine I run app - portfolio (it get messages from
> > portfolio
> > > data publisher - default from the same machine)
> > > I would like him to get the messages from the other machine (connect to
> > his
> > > ActiveMQ) - how can I do that?
> > >
> > > The problem should be easy -
> > > In the file webapps\demo\WEB-INF\web.xml Change from :
> > > <param-name>org.apache.activemq.brokerURL</param-name>
> > >        <param-value>vm://localhost</param-value>
> > > to
> > > <param-name>org.apache.activemq.brokerURL</param-name>
> > >        <param-value>vm://other_server_ip</param-value>"
> > >
> > > but it does not work or I'm doing it wrong.
> > >
> > > Can anyone help with that?
> > >
> > > Thanks,
> > > Jacek
> > >
> >
>

Re: Newbie problem with AJAX

Posted by Jacek Serafiński <ja...@gmail.com>.
Well,

I don't see any errors - and I don't see these messages.
You can try it by yourself with 2 machines using built-in example
(portfolio).

Cheers,
Jacek

On Fri, Mar 19, 2010 at 1:26 PM, Dejan Bosanac <de...@nighttale.net> wrote:

> Hi,
>
> that should do the trick. What errors are you seeing?
>
> Cheers
> --
> Dejan Bosanac - http://twitter.com/dejanb
>
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
>
>
> 2010/3/19 Jacek Serafiński <ja...@gmail.com>
>
> > Hi everyone,
> >
> > I have a newbie problem with ActiveMQ.
> > I'm trying to make a web app which will get messages using AJAX from a
> > different machine.
> >
> > Imagine:
> > 2 machines with ActiveMQ onboard.
> >
> > First runs a test webapp - portfolio data publisher
> >
> > On the second machine I run app - portfolio (it get messages from
> portfolio
> > data publisher - default from the same machine)
> > I would like him to get the messages from the other machine (connect to
> his
> > ActiveMQ) - how can I do that?
> >
> > The problem should be easy -
> > In the file webapps\demo\WEB-INF\web.xml Change from :
> > <param-name>org.apache.activemq.brokerURL</param-name>
> >        <param-value>vm://localhost</param-value>
> > to
> > <param-name>org.apache.activemq.brokerURL</param-name>
> >        <param-value>vm://other_server_ip</param-value>"
> >
> > but it does not work or I'm doing it wrong.
> >
> > Can anyone help with that?
> >
> > Thanks,
> > Jacek
> >
>

Re: Newbie problem with AJAX

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

that should do the trick. What errors are you seeing?

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


2010/3/19 Jacek Serafiński <ja...@gmail.com>

> Hi everyone,
>
> I have a newbie problem with ActiveMQ.
> I'm trying to make a web app which will get messages using AJAX from a
> different machine.
>
> Imagine:
> 2 machines with ActiveMQ onboard.
>
> First runs a test webapp - portfolio data publisher
>
> On the second machine I run app - portfolio (it get messages from portfolio
> data publisher - default from the same machine)
> I would like him to get the messages from the other machine (connect to his
> ActiveMQ) - how can I do that?
>
> The problem should be easy -
> In the file webapps\demo\WEB-INF\web.xml Change from :
> <param-name>org.apache.activemq.brokerURL</param-name>
>        <param-value>vm://localhost</param-value>
> to
> <param-name>org.apache.activemq.brokerURL</param-name>
>        <param-value>vm://other_server_ip</param-value>"
>
> but it does not work or I'm doing it wrong.
>
> Can anyone help with that?
>
> Thanks,
> Jacek
>