You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by manua <ag...@gmail.com> on 2009/03/30 20:21:04 UTC

How to integrate Ajax client with ActiveMQ CPP publisher

Hi All,

I am trying to run the Market data example of webapps/demo. I am able to run
the example with portfolio in one window and publisher in another window. 

I wan to run the same portfolio client, but instead of getting data from
publisher class I want portfolio to pick data sent by a CPP publisher. I was
trying to send the XML messages from CPP publisher/producer and recieved
them by the portfolio client. I modified the publisher code and hard codded
it to send data to one of the broker as STOCKS.SUNW, but it didn't work.

Kindly help me with this.

Any help in this regard will be highly appreciated.

Thanks,
Manu
-- 
View this message in context: http://www.nabble.com/How-to-integrate-Ajax-client-with-ActiveMQ-CPP-publisher-tp22789525p22789525.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to integrate Ajax client with ActiveMQ CPP publisher

Posted by manua <ag...@gmail.com>.


manua wrote:
> 
> HI Tim,
> 
> I have tried that part. With this publisher, I am able to publish messages
> and consume them throgh another Java consumer or cpp consumer. The problem
> comes in consuming the data through ajax client. I need your advice on
> that part. 
> 
> 
> My intention is to publish data to the broker from a cpp publisher and
> that data should be fetched by ajax client, eg. I want my CPP code to send
> data tothe broker, which portfolio.html should display in real tiem.
>  
> Mu publisher is sending data as I could see the messages in cosole, but
> they are not recieved by the client.
> 
> PLease let me know if I am doing any thing wrong or I ahve to use some
> other procedure.
> 
> Hope for an early reply.
>  
> Thanks,
> Manu
> 
> 
> 
> Timothy Bish wrote:
>> 
>> On Tue, 2009-03-31 at 04:45 -0700, manua wrote:
>>> Hi Tim,
>>> 
>>> I am using the sample webapps/demo. I am running the ajax
>>> client(portfolio.html) without modification. Instead of running
>>> publisher
>>> from demo, i am running SimpleProducer.cpp to send the messages to the
>>> broker and wants client to pick data from there. For testing purpose, I
>>> have
>>> specified the topic as STOCKS.SUNW and modified the text message as,
>>> 
>>> string text = (string)"<price stock=SUNW" + (string)"bid=" +
>>> Integer::toString(bid) + (string)"offer=" + Integer::toString(offer) +
>>> (string)" movement=" + movement +  "/>";
>>> 
>>> My intention is to publish data to the broker from a cpp publisher and
>>> that
>>> data should be fetched by ajax client, eg. I want my CPP code to send
>>> data
>>> tothe broker, which portfolio.html should display in real tiem.
>>> 
>>> PLease let me know if I am doing any thing wrong or I ahve to use some
>>> other
>>> procedure.
>>> 
>>> Hope for an early reply.
>>> 
>>> Thanks,
>>> Manu
>> 
>> My first recommendation would be to take a step back and first try and
>> get the CPP client code to produce a message and consume it via a Java
>> app or another C++ client, that way you know you've gotten the
>> publishing code right, then once you have that right you can move on to
>> trying to get the data in the webapp.  
>> 
>> Regards
>> Tim.
>> 
>> 
>> -- 
>> Tim Bish
>> http://fusesource.com
>> http://timbish.blogspot.com/
>> 
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-integrate-Ajax-client-with-ActiveMQ-CPP-publisher-tp22789525p22805099.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How to integrate Ajax client with ActiveMQ CPP publisher

Posted by manua <ag...@gmail.com>.
HI Tim,

I have tried that part. With this publisher, I am able to publish messages
and consume them throgh another Java consumer or cpp consumer. The problem
comes in consuming the data through ajax client. I need your advice on that
part. 


My intention is to publish data to the broker from a cpp publisher and that
data should be fetched by ajax client, eg. I want my CPP code to send data
tothe broker, which portfolio.html should display in real tiem.
 
Mu publisher is sending data as I could see the messages in cosole, but they
are not recieved by the client.

PLease let me know if I am doing any thing wrong or I ahve to use some other
procedure.

Hope for an early reply.
 
Thanks,
Manu



Timothy Bish wrote:
> 
> On Tue, 2009-03-31 at 04:45 -0700, manua wrote:
>> Hi Tim,
>> 
>> I am using the sample webapps/demo. I am running the ajax
>> client(portfolio.html) without modification. Instead of running publisher
>> from demo, i am running SimpleProducer.cpp to send the messages to the
>> broker and wants client to pick data from there. For testing purpose, I
>> have
>> specified the topic as STOCKS.SUNW and modified the text message as,
>> 
>> string text = (string)"<price stock=SUNW" + (string)"bid=" +
>> Integer::toString(bid) + (string)"offer=" + Integer::toString(offer) +
>> (string)" movement=" + movement +  "/>";
>> 
>> My intention is to publish data to the broker from a cpp publisher and
>> that
>> data should be fetched by ajax client, eg. I want my CPP code to send
>> data
>> tothe broker, which portfolio.html should display in real tiem.
>> 
>> PLease let me know if I am doing any thing wrong or I ahve to use some
>> other
>> procedure.
>> 
>> Hope for an early reply.
>> 
>> Thanks,
>> Manu
> 
> My first recommendation would be to take a step back and first try and
> get the CPP client code to produce a message and consume it via a Java
> app or another C++ client, that way you know you've gotten the
> publishing code right, then once you have that right you can move on to
> trying to get the data in the webapp.  
> 
> Regards
> Tim.
> 
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-integrate-Ajax-client-with-ActiveMQ-CPP-publisher-tp22789525p22804937.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How to integrate Ajax client with ActiveMQ CPP publisher

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2009-03-31 at 04:45 -0700, manua wrote:
> Hi Tim,
> 
> I am using the sample webapps/demo. I am running the ajax
> client(portfolio.html) without modification. Instead of running publisher
> from demo, i am running SimpleProducer.cpp to send the messages to the
> broker and wants client to pick data from there. For testing purpose, I have
> specified the topic as STOCKS.SUNW and modified the text message as,
> 
> string text = (string)"<price stock=SUNW" + (string)"bid=" +
> Integer::toString(bid) + (string)"offer=" + Integer::toString(offer) +
> (string)" movement=" + movement +  "/>";
> 
> My intention is to publish data to the broker from a cpp publisher and that
> data should be fetched by ajax client, eg. I want my CPP code to send data
> tothe broker, which portfolio.html should display in real tiem.
> 
> PLease let me know if I am doing any thing wrong or I ahve to use some other
> procedure.
> 
> Hope for an early reply.
> 
> Thanks,
> Manu

My first recommendation would be to take a step back and first try and
get the CPP client code to produce a message and consume it via a Java
app or another C++ client, that way you know you've gotten the
publishing code right, then once you have that right you can move on to
trying to get the data in the webapp.  

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: How to integrate Ajax client with ActiveMQ CPP publisher

Posted by manua <ag...@gmail.com>.
Hi Tim,

I am using the sample webapps/demo. I am running the ajax
client(portfolio.html) without modification. Instead of running publisher
from demo, i am running SimpleProducer.cpp to send the messages to the
broker and wants client to pick data from there. For testing purpose, I have
specified the topic as STOCKS.SUNW and modified the text message as,

string text = (string)"<price stock=SUNW" + (string)"bid=" +
Integer::toString(bid) + (string)"offer=" + Integer::toString(offer) +
(string)" movement=" + movement +  "/>";

My intention is to publish data to the broker from a cpp publisher and that
data should be fetched by ajax client, eg. I want my CPP code to send data
tothe broker, which portfolio.html should display in real tiem.

PLease let me know if I am doing any thing wrong or I ahve to use some other
procedure.

Hope for an early reply.

Thanks,
Manu




Timothy Bish wrote:
> 
> On Mon, 2009-03-30 at 11:21 -0700, manua wrote:
>> Hi All,
>> 
>> I am trying to run the Market data example of webapps/demo. I am able to
>> run
>> the example with portfolio in one window and publisher in another window. 
>> 
>> I wan to run the same portfolio client, but instead of getting data from
>> publisher class I want portfolio to pick data sent by a CPP publisher. I
>> was
>> trying to send the XML messages from CPP publisher/producer and recieved
>> them by the portfolio client. I modified the publisher code and hard
>> codded
>> it to send data to one of the broker as STOCKS.SUNW, but it didn't work.
>> 
>> Kindly help me with this.
>> 
>> Any help in this regard will be highly appreciated.
> 
> Without seeing code its hard to know why your AJAX client didn't receive
> messages sent by the C++ producer.  If you want to pass along any code
> snippets that demonstrate what you are doing I can try and help out.
> 
> Regards
> Tim.
> 
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-integrate-Ajax-client-with-ActiveMQ-CPP-publisher-tp22789525p22803435.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How to integrate Ajax client with ActiveMQ CPP publisher

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2009-03-30 at 11:21 -0700, manua wrote:
> Hi All,
> 
> I am trying to run the Market data example of webapps/demo. I am able to run
> the example with portfolio in one window and publisher in another window. 
> 
> I wan to run the same portfolio client, but instead of getting data from
> publisher class I want portfolio to pick data sent by a CPP publisher. I was
> trying to send the XML messages from CPP publisher/producer and recieved
> them by the portfolio client. I modified the publisher code and hard codded
> it to send data to one of the broker as STOCKS.SUNW, but it didn't work.
> 
> Kindly help me with this.
> 
> Any help in this regard will be highly appreciated.

Without seeing code its hard to know why your AJAX client didn't receive
messages sent by the C++ producer.  If you want to pass along any code
snippets that demonstrate what you are doing I can try and help out.

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: How to integrate Ajax client with ActiveMQ CPP publisher

Posted by FYang <fy...@mitre.org>.
Did you resolve this issue? How?  I got the same issue in java publisher.

Thanks

-Fran

manua wrote:
> 
> Hi All,
> 
> I am trying to run the Market data example of webapps/demo. I am able to
> run the example with portfolio in one window and publisher in another
> window. 
> 
> I wan to run the same portfolio client, but instead of getting data from
> publisher class I want portfolio to pick data sent by a CPP publisher. I
> was trying to send the XML messages from CPP publisher/producer and
> recieved them by the portfolio client. I modified the publisher code and
> hard codded it to send data to one of the broker as STOCKS.SUNW, but it
> didn't work.
> 
> Kindly help me with this.
> 
> Any help in this regard will be highly appreciated.
> 
> Thanks,
> Manu
> 

-- 
View this message in context: http://www.nabble.com/How-to-integrate-Ajax-client-with-ActiveMQ-CPP-publisher-tp22789525p24018533.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.