Hi,
Based on your example, the following will happen in JBI.
1> Camel SA1 invoking the JBI service myService will cause the following
additional work to take place.It will cause the running thread in the
servicemix-camel component to create an In-only Message exchange, copy the
message from the processor to the exchange. The exchange will be sent to the
NMR to locate and forward to myService.
2> Now myService though in another SA is also a servicemix-camel endpoint
registered with the NMR and will cause the exchange to be picked up by
another servicemix-camel thread and processed. The payload will be pulled
out of the JBI Message exchange and moved into a Camel Exchange that is
forwarded to the second processor. The JBI Message exchange is now set to
Done and pushed back and sent to the original thread for Camel-SA1 for
further processing and cleanup (due to JBI MEP processing rules).
3> The exchnage cleanup has to be done by the servicemix container after
the servicemix-camel thread SA1 does nothing further with the exchange.
The trouble you run into when it is all running in the same servicemix-camel
container is that the code becomes re-entrant, more and more time is spent
in exchange creation and management within servicemix-camel, exchanges start
to pile up pretty quickly, thereby driving down the overall processing
speed. Also, this activity chews up threads pretty quickly in a high volume
scenario.
Note that this does not happen in the pure JMS situation. The
servicemix-camel component does not have to create any fresh JBI exchanges
and manage them since it has no NMR involved. The camel routing scenario can
entirely executed in a running thread that can grab a message from the
Broker managing the Topic, process and and send it to another Topic. Another
thread then picks up from the second Topic and processes the message. There
is no need to create and manage JBI exchanges. I guess the difference is the
difference between a routing and a bridging scenario. Hence the much better
performance.
Hope this helps. The only thing that surprised me was how much the cost
differential was. You might try to increase the number of threads for the
Camel component via configuration (servicemix.properties in the conf
directory) and see if that makes a difference. I bet increasing the thread
pool will improve performance, however the performance of the pure-JMS
solution should improve as well :).
Cheers,
Ashwin...
GrkEngnr wrote:
>
> I guess I'm asking if JBI will perform better than or worse than JMS. My
> setup has 2 camel SAs the first one receives data on a ActiveMQ topic and
> then passes the processed data to another SA within the same Servicemix. I
> was under the impression that I should use JBI between the 2 SAs, but
> we've found much better performance with JMS.
>
> For instance,
>
> Camel SA 1: (JMS sender)
>
> from("activemq:topic:myInputTopic").process(new
> Processor()).to("activemq:topic:myInternalTopic");
>
> Camel SA 2: (JMS Receiver)
>
> from("activemq:topic:myInternalTopic").process(newProcessor());
>
> Camel SA 1: (JBI sender)
>
> from("activemq:topic:myInputTopic").process(new
> Processor()).to("jbi:service:servicemix:myService");
>
> Camel SA 2: (JMS Receiver)
>
> from("jbi:service:servicemix:myService").process(newProcessor());
>
> We are seeing much better performance with the first setup (along with
> some JMS configuration) ~10k messages per second. With the second example
> with JBI, I'm seeing close to 20 messages per second.
>
>
> Ashwin Karpe wrote:
>>
>> Hi,
>>
>> When you say you swithch the Camel SA's from JMS to use JBI are you using
>> JMS Flow...?
>>
>> Can you also post a sample code (scrubbed if necessary) of what your
>> camel SA's look like? This is unusual...
>>
>> While JBI is certainly less performant than straight JMS communication
>> due to MEP conformance requirements,thereby increasing the number of
>> interactions between service endpoints and consequently JMS payloads
>> between components, it should not be as bad or come into play unless you
>> use JMS flow.
>>
>> Can you please clarify?
>>
>> Cheers,
>>
>> Ashwin...
>>
>> GrkEngnr wrote:
>>>
>>> Hello,
>>>
>>> I currently have a configuration in which I have 2 camel SA converting
>>> messeges and sending to a third camel SA. Currently we are using JMS as
>>> the connection between the SAs, but when I switch in camel to use JBI, I
>>> have horrible performance. JMS non-durable topic can send 10-12k
>>> messages per second. When I switch to JBI between the 2 camel SAs, I get
>>> about 20 messages per second.
>>>
>>> What am I missing? How can I configure the jbi for maximum throughput?
>>> All service assemblies are running in a single instance of Servicemix.
>>> Can I configure the NMR? (for instance are messages being persisted?)
>>>
>>
>>
>
>
-----
---
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
---
+1-972-304-9084 (Office)
+1-972-971-1700 (Mobile)
----
Blog: http://opensourceknowledge.blogspot.com/
--
View this message in context:
http://www.nabble.com/JBI-performance-tp21615804p21634435.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.