Re: How to retain exchange headers through RoutingSlip

2015-10-03 Thread Claus Ibsen
Hi

Ah yeah read from a file and a file does not include any headers when
you write to a file. The body is the content of the file. And all
headers is not stored. You need to do some kind of custom message
transformation if you want to include headers, and also when you read
the file. eg where should the headers be stored in the file?

On Sat, Oct 3, 2015 at 2:33 PM, David Hoffer  wrote:
> We add the headers where we create and/or call process on the routing
> slip...
>
> exchange.getIn().setHeader("customHeader1", somedata1);
> exchange.getIn().setHeader("customHeader2", somedata2);
> exchange.getIn().setHeader(routingSlipHeaderName, toUris);
> routingSlip.process(exchange);
>
> But then when when the message is handled by a processor bean we try to get
> the header back via
>
> String data1 = (String) exchange.getIn().getHeader("customHeader1");
>
> This always returns null and it removed the 'routingSlipHeaderName' header
> too that used used by the routing slip.  (Its okay that it removed this
> one...but need the others.)
>
> Here is the XML config for the receiving route.  The CopyFileProcessor is
> the one that does not get the custom headers.
>
>  class="com.issinc.jms.gangplank.impl.CopyFileProcessor">
> 
> 
>
>  xmlns="http://camel.apache.org/schema/spring";>
> 
>  uri="file://{{gangplank.data}}/toBackup/?delete=true&moveFailed=.error&filter=#partialFilter&delay=200"/>
> 
> 
> java.lang.Exception
> 
> false
> 
> 
> 
> 
>
>
>
>
> -Dave
>
> On Sat, Oct 3, 2015 at 2:27 AM, Claus Ibsen  wrote:
>
>> Where do you set those custom headers?
>>
>> On Fri, Oct 2, 2015 at 8:20 PM, David Hoffer  wrote:
>> > I'm using a RoutingSlip to route files but all custom headers set on the
>> > Exchange are discarded.  I assume that's because Camel assumes custom
>> > headers are not useful for file messages but I need a way to pass source
>> > information from the RoutingSlip to the file Processors.
>> >
>> > How can I do this?  Is there a way I can override the default behavior of
>> > removing all custom headers?
>> >
>> > -Dave
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2nd edition:
>> https://www.manning.com/books/camel-in-action-second-edition
>>



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition


Re: https REST DSL servicemix CamelHttpTransportServlet

2015-10-03 Thread sekaijin
only https
thank



--
View this message in context: 
http://camel.465427.n5.nabble.com/https-REST-DSL-servicemix-CamelHttpTransportServlet-tp5772098p5772226.html
Sent from the Camel - Users mailing list archive at Nabble.com.


MDC information mess up after sent to activemq endpoint

2015-10-03 Thread chiochuan
Hi Guy, 

How to keep data in MDC after sending to JMS/activemq endpoint? 

currently i have 2 bundle whereby 1 bundle is exposing as webservice using
cxf endpoint. For each request, i have generate UUID and set it to MDC for
logging propose and sent the message to activemq endpoint (synchronous
response). 

But when i getting back response from activemq, the transaction show in the
log changes. 

Any idea why cause this?

Thanks.

Regards,
Chio Chuan




--
View this message in context: 
http://camel.465427.n5.nabble.com/MDC-information-mess-up-after-sent-to-activemq-endpoint-tp5772230.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel:netty4: How to control the number of outgoing TCP connections

2015-10-03 Thread SteveR
I'm using *Camel 2.15.2* and *camel:netty4* on RHEL6 and I have a Camel route
that reads from a *SEDA *queue and sends via *netty4:tcp *to a remote host. 
When doing a load test in dev, I see that exactly 50 TCP connections get
established to the remote host. I would like to understand what controls how
many TCP connections that *camel-netty4 *attempts to establish to the remote
host.  I wonder if the remote host's *backlog *parameter is what limits it
to 50? But I'm more interested in the *camel-netty4* behavior, since it's
initiating the TCP connection attempts.

  Thanks, SteveR

Here's what the route looks like:


http://camel.apache.org/schema/spring";>




iso-8859-1




... and here's, what I see with *netstat *after starting the load test:

Proto Recv-Q Send-Q Local Address   Foreign Address 
   
State  
tcp0  0 0.0.0.0:7993 0.0.0.0:*  

LISTEN  
tcp0  0 10.262.134.26:8093  0.0.0.0:*   
   
LISTEN  
tcp0  0 10.262.134.26:9006  0.0.0.0:*   
   
LISTEN  
tcp0  0 10.262.172.26:58731 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58865 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58882 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58875 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.134.26:9006  10.262.160.24:44516 
   
ESTABLISHED 
tcp0  0 10.262.172.26:58877 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58871 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58894 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58908 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58906 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58876 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58904 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58862 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58896 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58863 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58737 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58881 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58867 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.134.26:9006  10.262.160.24:44514 
   
ESTABLISHED 
tcp0  0 10.262.172.26:58902 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:5 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58878 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58870 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58884 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58864 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.134.26:9006  10.262.160.24:44515 
   
ESTABLISHED 
tcp0  0 10.262.172.26:58879 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58869 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58868 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58909 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58889 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58861 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58886 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58905 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58735 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58887 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58901 10.262.153.73:9006  
   
ESTABLISHED 
tcp0  0 10.262.172.26:58903 10.262.153.73:9006  
   
ESTAB

Re: How to retain exchange headers through RoutingSlip

2015-10-03 Thread David Hoffer
We add the headers where we create and/or call process on the routing
slip...

exchange.getIn().setHeader("customHeader1", somedata1);
exchange.getIn().setHeader("customHeader2", somedata2);
exchange.getIn().setHeader(routingSlipHeaderName, toUris);
routingSlip.process(exchange);

But then when when the message is handled by a processor bean we try to get
the header back via

String data1 = (String) exchange.getIn().getHeader("customHeader1");

This always returns null and it removed the 'routingSlipHeaderName' header
too that used used by the routing slip.  (Its okay that it removed this
one...but need the others.)

Here is the XML config for the receiving route.  The CopyFileProcessor is
the one that does not get the custom headers.





http://camel.apache.org/schema/spring";>




java.lang.Exception

false








-Dave

On Sat, Oct 3, 2015 at 2:27 AM, Claus Ibsen  wrote:

> Where do you set those custom headers?
>
> On Fri, Oct 2, 2015 at 8:20 PM, David Hoffer  wrote:
> > I'm using a RoutingSlip to route files but all custom headers set on the
> > Exchange are discarded.  I assume that's because Camel assumes custom
> > headers are not useful for file messages but I need a way to pass source
> > information from the RoutingSlip to the file Processors.
> >
> > How can I do this?  Is there a way I can override the default behavior of
> > removing all custom headers?
> >
> > -Dave
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2nd edition:
> https://www.manning.com/books/camel-in-action-second-edition
>


Re: Cannot write null body to file - using ftp component

2015-10-03 Thread Claus Ibsen
You cannot have from inside a route, that is only to start a route.

You need to use the content enricher EIP
http://camel.apache.org/content-enricher.html

There is a pollEnrich you can use to poll a file.

On Fri, Oct 2, 2015 at 6:46 PM, dfgcamel  wrote:
> Thanks for the response Claus.
>
> I've tried the allowNullBody option but it still doesn't work.  I'm
> wondering if it could be that in my scenario, I branch and use the
> .to("file.. instead a .from("file...  I say this because  I had this
> partially working before without the branching and I used .from("file..
> directly after the .process( section.  is there a way to achieve a branch
> that still allows me to use the .from("file.. syntax?
>
> Thanks,
>
> Dennis...
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Cannot-write-null-body-to-file-using-ftp-component-tp5772164p5772192.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition


Re: How to retain exchange headers through RoutingSlip

2015-10-03 Thread Claus Ibsen
Where do you set those custom headers?

On Fri, Oct 2, 2015 at 8:20 PM, David Hoffer  wrote:
> I'm using a RoutingSlip to route files but all custom headers set on the
> Exchange are discarded.  I assume that's because Camel assumes custom
> headers are not useful for file messages but I need a way to pass source
> information from the RoutingSlip to the file Processors.
>
> How can I do this?  Is there a way I can override the default behavior of
> removing all custom headers?
>
> -Dave



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition


Re: cxf endpoint configuration in java DSL

2015-10-03 Thread calyan.bandi
Hi,

I do not think that the below initialization would listen for the requests
on the url provided in the SERVICE_ADDRESS. 

CxfEndpoint serviceEndpoint = new CxfEndpoint(SERVICE_ADDRESS,
cxfComponent);

You initialize the CxfEndpoint with the required properties. If you want to
use it as a producer, you use it as below:
from("...")
.to("soapClientEndpoint");
When used in the to() section, camel will know that you are trying to make
use of the producer capability of the cxf endpoint and hence would make a
SOAP/REST request to the URI provided.

And if you use it in the from() section then it would listen for any
incoming SOAP/REST requests.

Thanks,
Kalyan



--
View this message in context: 
http://camel.465427.n5.nabble.com/cxf-endpoint-configuration-in-java-DSL-tp5771538p5772217.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel bean parameter binding issue with Spring DSL

2015-10-03 Thread calyan.bandi
Hi,

You may try one of the below two approaches:

1. Redefine your method signature and use the Bean annotations.

public void transformBodyUsingStyleSheet(Exchange exchange,
@Header("organizationStyleSheet") String styleSheet)
{
 ..
}

2. If the above didn't work, modify the bean delcaration in your xml file as
below and have the method signature in java to hold the Header annotation. 


This will ensure that camel will apply its internal rules to match the exact
method with the signatures provided in the method. 

I have a similar use case in my project and both the approaches worked well
for me. I am using camel version of 2.13.2

Thanks,
Kalyan



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-bean-parameter-binding-issue-with-Spring-DSL-tp5772200p5772208.html
Sent from the Camel - Users mailing list archive at Nabble.com.


MultiMedia Message(MMS) with Apache Camel

2015-10-03 Thread imranrazakhan
HI,

I have developed sample to send MMS with Apache Camel

http://imranrazakh.blogspot.ae/2015/10/mms-with-apache-camel.html

Regards



--
View this message in context: 
http://camel.465427.n5.nabble.com/MultiMedia-Message-MMS-with-Apache-Camel-tp5772207.html
Sent from the Camel - Users mailing list archive at Nabble.com.