You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by ICAR <ic...@gmail.com> on 2007/09/20 17:22:27 UTC

Message exchange property

Hi.. We have another problem ;)

In a bean-component we create a message exchange, and we set a property.
Then we send this message to another component. If the receiver bean was
another bean-component, we can read this property. But if the receiver is a
camel component, we cannot read this. Why? here's the code:

Bean-Component
MessageExchange newExchange =
channel.createExchangeFactory().createExchange(exchange.getPattern());
newExchange.setProperty("test","valueTest");

Camel-Component
    public void configure() throws Exception {
        this.from("jbi:service:http://icar.unibas.it/FreESBee/Camel1")
        .process(new ProcessorFiltro())
       
.to("jbi:service:http://icar.unibas.it/FreESBee/WebService?mep=in-out");
    }
    
    private class ProcessorFiltro implements Processor{
        public void process(Exchange exchange) throws Exception {
            Map<String,Object> mappaProprieta = exchange.getProperties();
            logger.info("The message has " + mappaProprieta.size() + "
properties");  // WAS 0 :(
            logger.info(exchange.getProperty("test"));
        }
    }
-- 
View this message in context: http://www.nabble.com/Message-exchange-property-tf4488214s12049.html#a12799337
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Message exchange property

Posted by ICAR <ic...@gmail.com>.
sorry but i don't know how i can fix that

gnodet wrote:
> 
> Jbi properties should be propagated to the camel context.
> Maybe you can try to fix that and provide a patch ?
> 

-- 
View this message in context: http://www.nabble.com/Message-exchange-property-tf4488214s12049.html#a12800711
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Message exchange property

Posted by Guillaume Nodet <gn...@gmail.com>.
Jbi properties should be propagated to the camel context.
Maybe you can try to fix that and provide a patch ?

On 9/20/07, ICAR <ic...@gmail.com> wrote:
>
> Hi.. We have another problem ;)
>
> In a bean-component we create a message exchange, and we set a property.
> Then we send this message to another component. If the receiver bean was
> another bean-component, we can read this property. But if the receiver is a
> camel component, we cannot read this. Why? here's the code:
>
> Bean-Component
> MessageExchange newExchange =
> channel.createExchangeFactory().createExchange(exchange.getPattern());
> newExchange.setProperty("test","valueTest");
>
> Camel-Component
>     public void configure() throws Exception {
>         this.from("jbi:service:http://icar.unibas.it/FreESBee/Camel1")
>         .process(new ProcessorFiltro())
>
> .to("jbi:service:http://icar.unibas.it/FreESBee/WebService?mep=in-out");
>     }
>
>     private class ProcessorFiltro implements Processor{
>         public void process(Exchange exchange) throws Exception {
>             Map<String,Object> mappaProprieta = exchange.getProperties();
>             logger.info("The message has " + mappaProprieta.size() + "
> properties");  // WAS 0 :(
>             logger.info(exchange.getProperty("test"));
>         }
>     }
>
> --
> View this message in context: http://www.nabble.com/Message-exchange-property-tf4488214s12049.html#a12799337
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/