You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Gabriela Gheorghe <ga...@disi.unitn.it> on 2009/05/14 09:06:08 UTC

problem with message delivery to internal pojo bean

Hi,

 

I am having some trouble with messages sent to a static bean that are not
handled by the bean, and just hang there, giving no exception. I really hope
you could help me with an idea on this.

 

So I have a statically configured pojo bean, nothing special about it:

 

public class AnnotatedBean extends ComponentSupport implements
MessageExchangeListener{       

@Resource

private DeliveryChannel channel;   

     

public void onMessageExchange(MessageExchange exchange) throws
MessagingException {

      exchange.setStatus(ExchangeStatus.DONE);

      channel.send(exchange);}}

 

This bean is declared in the servicemix.xml in the activation spec, with a
component name, a service and endpoint name. It's fine, in the sense that I
see the endpoint is created, so this deployment seems correct.

 

However, when I want to send a message to this bean, with the ClientFactory
to create a client and then with this: 

InOnly clone = client.createInOnlyExchange();

clone.setStatus(ExchangeStatus.ACTIVE);

(put some content in clone)

clone.setEndpoint(se);

client.sendSync(clone);

 

then I see that the messages are send but the Bean seems not to receive
them, because onMessageExchange is never called. It's also strange that
using the code in the example, 

 

DocumentFragment epr = URIResolver.createWSAEPR(namespace :
annotatedBean);<- with seemingly correct values here

ServiceEndpoint se = client.getContext().resolveEndpointReference(epr);

 

Returns se null, but with the code below it manages to find it (at least se
is not null):

 

ServiceEndpoint se = client.getContext().getEndpoint(new QName(service name
with namespace, endpointname);, "AnnotatedBean");

 

 

Could you please give me a hint about why this occurs? 

Thank you very much.

 

Best,

Gabi