Hi,

we are trying to use the in-out pattern with the following route:

        <route id="route_fileTest" reform:name="Test1"
reform:systemName="test">
            <from uri="file:/BIFiles/input"/>
                        <setExchangePattern pattern="InOut"/>
            <to uri="activemq:queue:queue1?replyTo=queue2"/>
                        <to uri="file:/BIFiles/output"/>
        </route>  

We have an MDB listening to queue1. This beans reads the bytes of the file,
makes some modifications and then sends the bytes back with a ByteMessage
(the MDB does set the replyTo destination and the CorrelationID).

If we don't attempt to edit the name of the file:

  public void sendByteMessage(final byte[] bytes, final Message onReplyOf)
throws JMSException {
        log.info("Sending message");
        JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);
        MessageCreator msgCreator = new MessageCreator() {
            @Override
            public Message createMessage(Session session) throws
JMSException {
                BytesMessage msg = session.createBytesMessage();     
                msg.setJMSCorrelationID(onReplyOf.getJMSCorrelationID());
                msg.writeBytes(bytes);
                return msg;
            }
        };
        jmsTemplate.send(onReplyOf.getJMSReplyTo(), msgCreator);
    }

this works as expected. A file dropped in the input folder is consumed, and
a new file is created in the output folder. The  name of the file in the
output folder is the transaction id (as it is explained in the Camel
documentation).

However when we try to modify the name of the output file from the MDB by
doing the following:

msg.setStringProperty("camelFileName", "new.txt");

we get an error in Camel:
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
create directory: \.camel (could be because of denied permissions)

We are using Camel 2.12, ActiveMq-camel 5.8 




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Issue-with-in-out-pattern-tp4687089.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to