You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "ravi.4indra" <ra...@gmail.com> on 2015/12/07 23:51:05 UTC

Camel-JMS JMS Selector getting overridden by new requests

Hi 

We are having a issue where our Selector mesageid is being overidden by the
messageid from new requests. Its like endpoints are being cached and same
endpoints are being reused.

beanprocessor code

 @EndpointInject(uri = "bxJmscomponent:queueName")
    JmsEndpoint endpointJMS;

@EndpointInject
    ConsumerTemplate consumer;

 public void process(Exchange exchange){
//prepare JMS selector
String jmsselector = ""
//set selector
endpointJMS.setSelector(jmsselector);
//
  rspExchange = consumer.receiveNoWait(endpoint);
}


bean is of scope prototype a new bean will be created for every request. its
like endpoints are being cached somewhere and camel is returing the
endpoints from the cache instead of creating new.

Is there a option to tell camel to create a new endpoint for every request?

Thanks
Ravi



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-JMS-Selector-getting-overridden-by-new-requests-tp5774806.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-JMS JMS Selector getting overridden by new requests

Posted by Claus Ibsen <cl...@gmail.com>.
Yes if the endpoint uri is the same, then its cached in camel.

On Tue, Dec 8, 2015 at 6:21 PM, ravi.4indra <ra...@gmail.com> wrote:
> are the endpoints shared between multiple threads even if the bean is of
> protoype scope?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-JMS-Selector-getting-overridden-by-new-requests-tp5774806p5774838.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel-JMS JMS Selector getting overridden by new requests

Posted by "ravi.4indra" <ra...@gmail.com>.
are the endpoints shared between multiple threads even if the bean is of
protoype scope?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-JMS-Selector-getting-overridden-by-new-requests-tp5774806p5774838.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-JMS JMS Selector getting overridden by new requests

Posted by Claus Ibsen <cl...@gmail.com>.
No you would need to create the endpoint in the code instead of
injecting as that is a shared endpoint (its uri is the same).



On Mon, Dec 7, 2015 at 11:51 PM, ravi.4indra <ra...@gmail.com> wrote:
> Hi
>
> We are having a issue where our Selector mesageid is being overidden by the
> messageid from new requests. Its like endpoints are being cached and same
> endpoints are being reused.
>
> beanprocessor code
>
>  @EndpointInject(uri = "bxJmscomponent:queueName")
>     JmsEndpoint endpointJMS;
>
> @EndpointInject
>     ConsumerTemplate consumer;
>
>  public void process(Exchange exchange){
> //prepare JMS selector
> String jmsselector = ""
> //set selector
> endpointJMS.setSelector(jmsselector);
> //
>   rspExchange = consumer.receiveNoWait(endpoint);
> }
>
>
> bean is of scope prototype a new bean will be created for every request. its
> like endpoints are being cached somewhere and camel is returing the
> endpoints from the cache instead of creating new.
>
> Is there a option to tell camel to create a new endpoint for every request?
>
> Thanks
> Ravi
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-JMS-Selector-getting-overridden-by-new-requests-tp5774806.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2