You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "prabumca06@gmail.com" <pr...@gmail.com> on 2013/10/07 15:45:38 UTC

Re: AW: AW: Camel Routing using map message help required

My message is mapmessage.

I.e my map message contain key CREDITORDEBIT.I want check if it is credit i
want move message or i want discard the message 

I have added following code,But this didn't work.

.filter(property(CREDITORDEBIT).isEqualTo(CREDIT))


Please kindly help me.




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741033.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: AW: AW: Camel Routing using map message help required

Posted by "prabumca06@gmail.com" <pr...@gmail.com>.
i want use filter not when



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741047.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: AW: AW: Camel Routing using map message help required

Posted by Robert Simmons <kr...@gmail.com>.
Filter has to be first in the route.

Sent from my iPad

> On Oct 7, 2013, at 12:14 PM, "prabumca06@gmail.com" <pr...@gmail.com> wrote:
> 
> Sorry i have copied full code here
> 
> I hope it will give you idea what i am trying to achieve 
> 
> from(ACT_TYPE_SPECFIC_QNAME).choice()
>   .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))           
>   .filter(simple("{body[isCredit]} == true"))
>   .process(new Processor() {
>    public void process(Exchange exchange) {
>        Map map = (Map) exchange.getIn().getBody();
>        String Account_No = (String) map.get(ACCOUNT_ID);
>        Map<String,Object> newBody = new HashMap<String, Object>(); 
>        newBody.put(ACCOUNT_ID, Account_No); 
>        exchange.getIn().setBody(newBody);                                                        
>    }}).to(ACTIVATE_QNAME)
>   .endChoice()
>   .otherwise()
>   .setHeader(DESTINATION, constant(DESTINATION_VALUE))
>   .to(EROOR_QNAME)
>   .end();
> 
> Message reached ACT_TYPE_SPECFIC_QNAME but it only checking when (
> .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) )
> condition routing message to ACTIVATE_QNAME
> 
> Filter not working property in this case.
> 
> Please kindly help me
> 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741049.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: AW: AW: Camel Routing using map message help required

Posted by "prabumca06@gmail.com" <pr...@gmail.com>.
Sorry i have copied full code here

I hope it will give you idea what i am trying to achieve 

from(ACT_TYPE_SPECFIC_QNAME).choice()
   .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))           
   .filter(simple("{body[isCredit]} == true"))
   .process(new Processor() {
    public void process(Exchange exchange) {
        Map map = (Map) exchange.getIn().getBody();
        String Account_No = (String) map.get(ACCOUNT_ID);
        Map<String,Object> newBody = new HashMap<String, Object>(); 
        newBody.put(ACCOUNT_ID, Account_No); 
        exchange.getIn().setBody(newBody);                                                        
    }}).to(ACTIVATE_QNAME)
   .endChoice()
   .otherwise()
   .setHeader(DESTINATION, constant(DESTINATION_VALUE))
   .to(EROOR_QNAME)
   .end();
   
Message reached ACT_TYPE_SPECFIC_QNAME but it only checking when (
.when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) )
condition routing message to ACTIVATE_QNAME

Filter not working property in this case.

Please kindly help me




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741049.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: AW: AW: Camel Routing using map message help required

Posted by "kraythe ." <kr...@gmail.com>.
Ack ... premature submit ... check out the content based router EIP.

http://camel.apache.org/enterprise-integration-patterns.html

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


On Mon, Oct 7, 2013 at 11:45 AM, kraythe . <kr...@gmail.com> wrote:

> choice()
> .when(simple("${body[CREDITORDEBIT]} == true").to(credit_uri).endChoice()
> .otherwise().to(debit_uri)
> .end()
>
> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
> *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*
>
>
> On Mon, Oct 7, 2013 at 8:45 AM, prabumca06@gmail.com <prabumca06@gmail.com
> > wrote:
>
>> My message is mapmessage.
>>
>> I.e my map message contain key CREDITORDEBIT.I want check if it is credit
>> i
>> want move message or i want discard the message
>>
>> I have added following code,But this didn't work.
>>
>> .filter(property(CREDITORDEBIT).isEqualTo(CREDIT))
>>
>>
>> Please kindly help me.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741033.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>

Re: AW: AW: Camel Routing using map message help required

Posted by "kraythe ." <kr...@gmail.com>.
choice()
.when(simple("${body[CREDITORDEBIT]} == true").to(credit_uri).endChoice()
.otherwise().to(debit_uri)
.end()

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


On Mon, Oct 7, 2013 at 8:45 AM, prabumca06@gmail.com
<pr...@gmail.com>wrote:

> My message is mapmessage.
>
> I.e my map message contain key CREDITORDEBIT.I want check if it is credit i
> want move message or i want discard the message
>
> I have added following code,But this didn't work.
>
> .filter(property(CREDITORDEBIT).isEqualTo(CREDIT))
>
>
> Please kindly help me.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741033.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>