Hello all,
I have the code shown below calling a DefaultServiceMixClient instance to
send messages to ServiceMix.
ServiceMixClient client = getServiceMixClient();
InOnly exchange = client.createInOnlyExchange();
NormalizedMessage normalizedMessage = exchange.getInMessage();
normalizedMessage.setContent(new StringSource("<iteration>" + i +
"</iteration>"));
QName service = new QName("http://localhost/", "loadTestReceiver");
exchange.setService(service);
client.sendSync(exchange);
Where my servicemix.xml is configured as
<sm:activationSpec componentName="loadTestReceiver"
service="my:loadTestReceiver">
<sm:component>
<bean
class="org.apache.servicemix.components.jms.JmsSenderComponent">
<property name="template" ref="loadTestJmsTemplate"
/>
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec componentName="loadTestConsumer"
service="my:loadTestConsumer"
destinationService="my:loadTestWorker">
<sm:component>
<bean
class="org.apache.servicemix.components.jms.JmsReceiverComponent">
<property name="template" ref="loadTestJmsTemplate"
/>
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec componentName="loadTestWorker"
service="my:loadTestWorker">
<sm:component>
<bean
class="com._8020.mcc.servicemix.components.LoadTestWorker">
<property name="wait" value="500" />
</bean>
</sm:component>
</sm:activationSpec>
Where the loadTestWorker merely waits the specified amount of time and then
exits its onMessageExchange method.
This all works fine when I call the sendSync() method of the client, but if
I use the send() method, I notice that the client component's
inboundQueueSize grows to 1049 and then all of servicemix grinds to a sudden
halt.
I'd prefer to send the messages asynchronously to ServiceMix as I have no
need of an immediate reply. Am I missing something? Should one never use
DefaultServiceMixClient.send()?
Thanks.
Marc