A couple comments.  What you are describing sounds suspiciously like some of
your requests aren't being handled or returned properly.  Since you are
sending the requests asynchronously, then this would explain why it starts
hanging between 1000-1500 messages.  I actually have experienced the same
problem and while I thought it was a servicemix bug of some kind, it was a
problem in my message flow.  I would guarentee you that the service you are
sending messages to has a bug in it.  You might want to trace it and make
sure it's returning EVERY exchange.  If it received a request it can't
handle, then it should throw an exception.  It sounds like there is a can
where you aren't doing that.  If you mishandle an exchange, it will end up
sitting on a queue, hogging a thread and eventually you'll have the exact
situation you are describing.

As to your other question, the best way to send a message from a bean
component to another component is to follow the info on this page:

http://servicemix.apache.org/servicemix-bean.html

It tells you how to have a deliverychannel injected into your bean and you
can use that to send your exchanges.  Regardless, there is a problem with
exchanges hanging in your scenario.  I think if you look at jconsole and you
look at the stacktrace for some of those threads you might be able to see
why they are hanging or at the very least you'll see they are stuck in
transit.

Ryan

On Thu, Feb 25, 2010 at 10:02 AM, subh <[email protected]> wrote:

>
> Hi Freeman,
>
> I am using client.send. This is how I use it..
>
>        smxclient = SMXClient.getInstance();
>        Destination destination =
> smxclient.createDestination(ORS_EIP_STATIC_RECIPIENT_SERVICE);
>        Message message = destination.createInOnlyMessage();
>        message.setProperty(REPLY_HEADER, Boolean.TRUE);
>        message.setContent(new StringSource(messageBody));
>        smxclient.send(message);
>        smxclient.done(exchange);
>
>
> Eighty8 wrote:
> >
> > Perhaps related to my post about generateId( ) synchronized call is
> > blocking.  Only saw this with a profiler tool, but maybe you'd see it if
> > you took a thread dump and analyzed it.
> >
> >
> > subh wrote:
> >>
> >> I have a simple flow as below
> >>
> >> External message producer --> SMX JMS queue --> SMX Bean --> Camel
> router
> >> --> SMX JMS Topic
> >>
> >> The servicemix bean has the business logic to generate the outgoing
> >> message.
> >> To forward the message onto the next service, I am using
> >> ServiceMixClient.
> >>
> >> I am using the ClientFactory to create a instance of the client.
> >>
> >> ClientFactory factory = new
> >> InitialContext().lookup(ClientFactory.DEFAULT_JNDI_NAME);
> >> ServiceMixClient client = factory.createClient();
> >>
> >> But after processing 1000 - 1500 messages, the Servicemix bean component
> >> becomes very slow to respond. On checking the log, I see that the bean
> >> thread count increases considerably and the expired threads are not
> >> garbage collected.
> >>
> >> Due to this, all incoming messages are getting blocked which forces us
> to
> >> restart the servicemix server. Once it is restarted, the processing
> >> becomes very fast and we come to the same situation again in a day or
> so.
> >>
> >> Am I doing something wrong by using the ServicemixClient inside the
> bean?
> >> If no, then what are the best practices for using the Servicemix client
> >> class.
> >>
> >> Are there alternative ways to specify the "target service" from the SMX
> >> bean endpoint?
> >>
> >> Any hint or suggestion would be helpful.
> >>
> >> I am using activemq5.3 and servicemix 3.3
> >>
> >> Regards
> >> Subh
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/ServicemixBean-thread-issue..-tp27714350p27714450.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>

Reply via email to