Good morning, thanks for the response. I am using the built-in Camel to read a message from an ActiveMQ queue and the sending it externally using the camel-ftp component
The data placed in the ActiveMQ queue is few hundred KB binary file. I am not familiar with Routing Slip EIP or the headerFilterStrategy, are you able to provide some links or ideas surrounding these ideas? Jason ________________________________ From: Jean-Baptiste Onofré <[email protected]> Sent: Wednesday, February 25, 2026 1:18 AM To: [email protected] <[email protected]> Subject: Re: ActiveMQ Binary Message and SFTP Transfer CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. Hi Jason, Maybe you should use a headerFilterStrategy to avoid conflicts between JMS and Camel headers. If you want to use JMS message content for a Camel endpoint (to) configuration/uri, you might need to use the Routing Slip EIP, for example. Are you using the camel-jms component? It seems this is more of a Camel question than an ActiveMQ one. Regards, JB On Tue, Feb 24, 2026 at 9:13 PM Jason Jackson <[email protected]> wrote: > I have an application that is sending a pure binary file to an ActiveMQ > queue. > > The message details of the binary file contains information related to the > file. One component in the message details is the following: > > filename=myfile.txt > > Using the embedded Camel functionality and capabilities of ActiveMQ I am > performing the following actions. > > This is valid and ActiveMQ loads without any issues > > <setVariable name="myFileName"> > <simple>${bodyAs(String)} > regex('(?s).*filename=([a-zA-Z0-9_\-\.]+).*')</simple> > </setVariable> > > > My uri is the following > > <to uri="sftp://username@ip > /dir?password=myPassword&autoCreate=true&binary=true&passiveMode=true&knownHostsFile=/myHostFile&fileName=${myFileName}"/> > > As soon as I add fileName=${myFileName} to the URI, ActiveMQ throws an > error and fails to load. An example of the error is: > > Exception encountered during context initialization - cancelling refresh > attempt: org.apache.camel.FailedToCreateRouteException: Failed to create > route: QUEUE1 at: >>> > To[sftp://username@ip/dir?password=xxxxxx&autoCreate=true&binary=true&passiveMode=true&knownHostsFile=/myHostFile&fileName=${myFileName}] > <<< in route: Route(QUEUE1)[From[jms:queue://QUEUE1... because: Failed to > resolve endpoint: > sftp://username@ip/dir?autoCreate=true&binary=true&fileName=myFileName&knownHostsFile=/myHostFile&passiveMode=true&password=xxxxxx > due to: Error binding property (fileName=${myFileName}) with name: fileName > on bean: > sftp://username@ip/dir?autoCreate=true&binary=true&fileName=myFileName&knownHostsFile=/myHostFile&passiveMode=true&password=xxxxxx > with value: ${myFileName} | org.apache.activemq.xbean.XBeanBrokerFactory$1 > | main > > If I do not attempt to set the filename and just send the file over it > connects via sftp and the file transfers without any issues, the issue is I > need to set the file name to what is in the message details. > > I have attempted to load the uri using the toD dynamic option and it fails > also. This error states it failed with an excepting and just provides a > print out of the uri I am attempting to connect to. > > I used the following link, > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F4.14.x%2Fsftp-component.html%23_usage&data=05%7C02%7Cjason.jackson%40itechag.com%7Cc6297dc4303442e2b39a08de7435d6ea%7C07e5f1b9902a4d9f974c04601319bfec%7C0%7C0%7C639075971772832707%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=l8ssROO3PRpgj3mi4BjvQlb%2FuImdvLetnpjb1600t%2BY%3D&reserved=0<https://camel.apache.org/components/4.14.x/sftp-component.html#_usage>, > for the Camel commands/settings. > > Does anyone have a suggestion on what I may be doping wrong or if there is > an additional entry/setting that I need? > > Jason >
