You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by baklarz <td...@gmail.com> on 2011/08/10 15:10:30 UTC

activemq router pattern, problem with

Hi, I want to use this:
http://camel.apache.org/message-router.html
http://camel.apache.org/simple.html

        <route>
            <from uri="activemq:queue:Notification.EndDonationSuccessEvent"
/>
            <bean ref="mailNotificationTranslator"
method="prepareOrganizationNotification" />
            <choice>
                <when>
                    <simple>'tomasz@example.com'!= ${body[sendTo]}</simple>
                    <to uri="activemq:queue:MAIL_NOTIFICATIONS" />
                </when>
            </choice>
        </route>

In message body is HashMap with key 'sendTo'. I want to route all messages
except those to  tomasz@example.com.

<when> is completly ignored (no matter !=,>==),  alle messages are routed to
activemq:queue:MAIL_NOTIFICATIONS.
Where is problem ? 





--
View this message in context: http://camel.465427.n5.nabble.com/activemq-router-pattern-problem-with-when-tp4685750p4685750.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: activemq router pattern, problem with

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Aug 10, 2011 at 3:10 PM, baklarz <td...@gmail.com> wrote:
> Hi, I want to use this:
> http://camel.apache.org/message-router.html
> http://camel.apache.org/simple.html
>
>        <route>
>            <from uri="activemq:queue:Notification.EndDonationSuccessEvent"
> />
>            <bean ref="mailNotificationTranslator"
> method="prepareOrganizationNotification" />
>            <choice>
>                <when>
>                    <simple>'tomasz@example.com'!= ${body[sendTo]}</simple>
>                    <to uri="activemq:queue:MAIL_NOTIFICATIONS" />
>                </when>
>            </choice>
>        </route>
>
> In message body is HashMap with key 'sendTo'. I want to route all messages
> except those to  tomasz@example.com.
>
> <when> is completly ignored (no matter !=,>==),  alle messages are routed to
> activemq:queue:MAIL_NOTIFICATIONS.
> Where is problem ?
>

There must be spaces around the operator.
Also the ${body} is preferred to be on the left hand side, so swap
them, and make sure there is spaces around the operator.



>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/activemq-router-pattern-problem-with-when-tp4685750p4685750.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/