You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by JigarP <ji...@gmail.com> on 2007/09/12 05:47:22 UTC

ActiveMQ performance(activemq +ajax)

Hi All, 

    I had posted on issue related to activemq and ajax but i did not get
reply for that. I am having below issue. 

1) I am using javascript setInterval method and calling amq.addListener
method every 3 seconds as if i use default behaviour of activemq +ajax then
sometime i am not able to get reply from server even if data is there in
activemq(confirmed using Jconsole). 

if i am calling amq.addListener then it is creating performance issue. means
it eats more CPU. 

   Can you suggest me that above is the rgt approach or i should use other
approach so that i can get all messages without loosing them. 

   if above approach is correct then can you guide me how can i improve
performance activemq?? 

awaiting your reply, 

thanking you in advance, 

J 


-- 
View this message in context: http://www.nabble.com/ActiveMQ-performance%28activemq-%2Bajax%29-tf4426785s2354.html#a12628181
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ performance(activemq +ajax)

Posted by chago <na...@visualxs.com>.
J, I'm not an authority on this topic, but I will try to carve out some time
to write a js-based load test. When working on problems like this, a plugin
like Firebug will help you out quite a bit. There are IE equivalents. This
can help identify whether the client never sends the message, or the server
never replies, or if the messages were received but not processed.


-- 
View this message in context: http://www.nabble.com/ActiveMQ-performance%28activemq-%2Bajax%29-tf4426785s2354.html#a12727147
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ performance(activemq +ajax)

Posted by JigarP <ji...@gmail.com>.
Hi Chago,

                 I have done configuration what you mentioned below and
integration works fine. i am having some issue as what i had previously.
means if i run more than 8+ then it is behaving like previously only. this
time lots of client was not able to bid. I am not undestanding where is the
issue. Please guide me to get solution for this. 

awaiting your reply,
J



chago wrote:
> 
> The amq.js file that ships with ActiveMQ will automagically load for you,
> prototype.js, behavior.js and _amq.js. The real work is done in _amq.js
> which communicates with the AjaxServlet to create a javascript JMS client.
> The _amq.js needs to make some AJAX calls to the server, thus the
> inclusion of prototype. (The behaviour.js file was included to support the
> examples and should not be part of amq.js.) 
> 
> If you try out my patch, I have made amq.js a standalone javascript file
> that still contains all the logic that existed previously. However, I
> don't try to load prototype.js. I include an adapter class to allow amq.js
> to make AJAX calls using the developer's preferred AJAX library. There are
> adapters included for prototype and jQuery.
> 
> So, if you look at the chat.html sample included in the "patch" you will
> see the html and script initialization you need to perform:
> 
> <script type="text/javascript" src="j/prototype.js"></script>
> <script type="text/javascript" src="j/amq_prototype_adapter.js"></script>
> <script type="text/javascript" src="j/amq.js"></script>
> <script>
>     window.onload = function() {
>         org.activemq.Amq.init({ uri: 'amq', logging: true, timeout: 45 });
>     };
> </script>
> 
> Please let me know if you have any further questions. Also, if you have
> your code boiled down to abre essentials, I would be happy to try it
> locally.
> 
> -- jim
> 
> 
> JigarP wrote:
>> 
>> as you have mentioned path for js, so how many js i have to use from zip
>> file as there are different js. 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-performance%28activemq-%2Bajax%29-tf4426785s2354.html#a12649114
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ performance(activemq +ajax)

Posted by chago <na...@visualxs.com>.
The amq.js file that ships with ActiveMQ will automagically load for you,
prototype.js, behavior.js and _amq.js. The real work is done in _amq.js
which communicates with the AjaxServlet to create a javascript JMS client.
The _amq.js needs to make some AJAX calls to the server, thus the inclusion
of prototype. (The behaviour.js file was included to support the examples
and should not be part of amq.js.) 

If you try out my patch, I have made amq.js a standalone javascript file
that still contains all the logic that existed previously. However, I don't
try to load prototype.js. I include an adapter class to allow amq.js to make
AJAX calls using the developer's preferred AJAX library. There are adapters
included for prototype and jQuery.

So, if you look at the chat.html sample included in the "patch" you will see
the html and script initialization you need to perform:

<script type="text/javascript" src="j/prototype.js"></script>
<script type="text/javascript" src="j/amq_prototype_adapter.js"></script>
<script type="text/javascript" src="j/amq.js"></script>
<script>
    window.onload = function() {
        org.activemq.Amq.init({ uri: 'amq', logging: true, timeout: 45 });
    };
</script>

Please let me know if you have any further questions. Also, if you have your
code boiled down to abre essentials, I would be happy to try it locally.

-- jim


JigarP wrote:
> 
> as you have mentioned path for js, so how many js i have to use from zip
> file as there are different js. 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-performance%28activemq-%2Bajax%29-tf4426785s2354.html#a12639023
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ performance(activemq +ajax)

Posted by JigarP <ji...@gmail.com>.
Hi Chago,

    Thanks for reply, I have different topic for different client. so they
are communicating using different topic name only. i am getting this issue
if i have simultanous user more than 10+. I had done one changes to call
amqListener every 3 sec using javascript window.setInterval method but when
i use more than 10+ user then i am not getting that data at client side but
i am able to see in Activemq(using JConsole).   

as you have mentioned path for js, so how many js i have to use from zip
file as there are different js. 

awaiting your reply,

Thanks again.

J

chago wrote:
> 
> Can you try the amq.js file located at:
> 
> https://issues.apache.org/activemq/browse/AMQ-1377
> 
> Are each of these listeners connected to a different queue or topic? How
> many do you have before you notice some unresponsiveness?
> 
> -- jim
> 
> 
> JigarP wrote:
>> 
>> Hi All, 
>> 
>>     I had posted on issue related to activemq and ajax but i did not get
>> reply for that. I am having below issue. 
>> 
>> 1) I am using javascript setInterval method and calling amq.addListener
>> method every 3 seconds as if i use default behaviour of activemq +ajax
>> then sometime i am not able to get reply from server even if data is
>> there in activemq(confirmed using Jconsole). 
>> 
>> if i am calling amq.addListener then it is creating performance issue.
>> means it eats more CPU. 
>> 
>>    Can you suggest me that above is the rgt approach or i should use
>> other approach so that i can get all messages without loosing them. 
>> 
>>    if above approach is correct then can you guide me how can i improve
>> performance activemq?? 
>> 
>> awaiting your reply, 
>> 
>> thanking you in advance, 
>> 
>> J 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-performance%28activemq-%2Bajax%29-tf4426785s2354.html#a12634099
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ performance(activemq +ajax)

Posted by chago <na...@visualxs.com>.
Can you try the amq.js file located at:

https://issues.apache.org/activemq/browse/AMQ-1377

Are each of these listeners connected to a different queue or topic? How
many do you have before you notice some unresponsiveness?

-- jim


JigarP wrote:
> 
> Hi All, 
> 
>     I had posted on issue related to activemq and ajax but i did not get
> reply for that. I am having below issue. 
> 
> 1) I am using javascript setInterval method and calling amq.addListener
> method every 3 seconds as if i use default behaviour of activemq +ajax
> then sometime i am not able to get reply from server even if data is there
> in activemq(confirmed using Jconsole). 
> 
> if i am calling amq.addListener then it is creating performance issue.
> means it eats more CPU. 
> 
>    Can you suggest me that above is the rgt approach or i should use other
> approach so that i can get all messages without loosing them. 
> 
>    if above approach is correct then can you guide me how can i improve
> performance activemq?? 
> 
> awaiting your reply, 
> 
> thanking you in advance, 
> 
> J 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-performance%28activemq-%2Bajax%29-tf4426785s2354.html#a12633789
Sent from the ActiveMQ - User mailing list archive at Nabble.com.