Re: SJMS and InOut

2013-02-13 Thread Harald Wellmann
Well, it should be clearly documented that inOut() does not have the
desired effect and that camel-sjms behaves differently than camel-jms
in this respect.

I can live with the current approach, and I'm eager to see a release
of camel-sjms in 2.11 to get rid of the transitive Spring dependency
in my Java EE app which is not required except by camel-jms.

But it would be useful to remove that restriction in the next release.

We use bean invocations tunnelled through JMS a lot, and it should be
possible to have InOut methods and InOnly methods in the same service
interface, tunneled through the same queue.

Best regards,
Harald


building route in java dsl

2013-02-13 Thread kiranreddykasa

Can anyone tell me how to build camel route dynamically in dsl.

I am aware of recepientlist, dynamic router.

Suppose I have a list of endpoint url's, how can i build route by iterating
the list ?? 

List listOfEndpoints=

In Route builder configure method can i define a single route in multiple
steps???

for eg..

from(listOfEndpoints.get(0));
iterating
  to(listOfEndpoints.get(..));


something like  this??





-
Regards

kiran Reddy
--
View this message in context: 
http://camel.465427.n5.nabble.com/building-route-in-java-dsl-tp5727483.html
Sent from the Camel - Users mailing list archive at Nabble.com.


AW: building route in java dsl

2013-02-13 Thread jhm
Even a JavaDSL is Java code, so you could store intermediate steps while
creating the route - just "extract local variable".
So you could use Java control commands:


public class ProgrammaticalRouteTest extends CamelTestSupport {

@Test 
public void sendToMultipleEndpoints() throws InterruptedException {
getMockEndpoint("mock:end1").expectedMessageCount(1);
getMockEndpoint("mock:end2").expectedMessageCount(1);
getMockEndpoint("mock:end3").expectedMessageCount(1);
template.sendBody("direct:in", "test");
assertMockEndpointsSatisfied();
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
List endpointUris = Arrays.asList(
"mock:end1",
"mock:end2",
"mock:end3"
);

RouteDefinition route = from("direct:in");
for(String epUri : endpointUris) {
route.to(epUri);
}
}
};
}
}


Jan

-Ursprüngliche Nachricht-
Von: kiranreddykasa [mailto:kirankuma...@fss.co.in] 
Gesendet: Mittwoch, 13. Februar 2013 10:13
An: users@camel.apache.org
Betreff: building route in java dsl


Can anyone tell me how to build camel route dynamically in dsl.

I am aware of recepientlist, dynamic router.

Suppose I have a list of endpoint url's, how can i build route by iterating
the list ?? 

List listOfEndpoints=

In Route builder configure method can i define a single route in multiple
steps???

for eg..

from(listOfEndpoints.get(0));
iterating
  to(listOfEndpoints.get(..));


something like  this??





-
Regards

kiran Reddy
--
View this message in context:
http://camel.465427.n5.nabble.com/building-route-in-java-dsl-tp5727483.html
Sent from the Camel - Users mailing list archive at Nabble.com.



How add a property ?

2013-02-13 Thread anakin59490
hello,

I would like to add a property in the file which is defined in my
camelContext :



In my filtersDefinition_dev.properties file, i wrote :
sepa.splitter=test

and i would like to add a new property : sepa.splitter2=test2

I try to do that in a bean :

@Resource(name="properties")
protected CamelPropertyPlaceholderDefinition filters;


but i don't find the equivalent of setProperty (java.util.Properties)
method.


Why do i want to add it in filterDefinition_dev.properties ?

Because i would like to use this new property in a camel route like this :

from("direct:transformXML")
 .beanRef("myClass", "myMethod")  -> create the new property
(sepa.splitter2=test2) 
 .split().tokenizeXML("{{sepa.splitter2}"}


I don't find example on the web

Can you help me ?












--
View this message in context: 
http://camel.465427.n5.nabble.com/How-add-a-property-tp5727488.html
Sent from the Camel - Users mailing list archive at Nabble.com.


DestinationResolver for Reply Messages

2013-02-13 Thread prueegg
I need to connect to WebSphere MQ and set the correct header fields in the
WMQ message header.

This works fine for simple fire&forget as well as for request messages since
I'm using a DestinationResolver to set all the required poperties to the
destination.

public Destination resolveDestinationName(Session session, String
destinationName, boolean isPubSubDomain) throws JMSException {
LOGGER.debug("Resolve Destination Name: " + destinationName);
Destination destination = super.resolveDestinationName(session,
destinationName, isPubSubDomain);
if (destination instanceof MQDestination) {
MQDestination mqDestination = (MQDestination) destination;
mqDestination.setEncoding(getEncoding());
mqDestination.setFailIfQuiesce(getFailIfQuiesce());
mqDestination.setTargetClient(getTargetClient());
mqDestination.setMQMDWriteEnabled(true);
mqDestination.setMQMDReadEnabled(true);
   
mqDestination.setMQMDMessageContext(CommonConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);
mqDestination.setPriority(CommonConstants.WMQ_PRI_QDEF);
mqDestination.setPersistence(CommonConstants.WMQ_PER_QDEF);
// mqDestination.setExpiry(CommonConstants.WMQ_EXP_UNLIMITED);
}
return destination;
}

The problem is, that the destination resolver is not called for the replyTo
destination given by the WMQ message.

How can I apply the properties mentioned above also for the replyTo
destination?

Patrick



--
View this message in context: 
http://camel.465427.n5.nabble.com/DestinationResolver-for-Reply-Messages-tp5727490.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to handle error when - Renaming file from: *** failed due cannot delete from file

2013-02-13 Thread briane80
Hi,

I'm using camel 2.10.3 on windows 7.

I have a route set up as follows:

errorHandler("file:C:\\Errors").maximumRedeliveries(3).redeliveryDelay(5000).retryAttemptedLogLevel(LoggingLevel.WARN).useOriginalMessage());

from("file:C:\\Messages\\Inbox?consumer.delay=5000&include=.*.gz").unmarshal().gzip().to("file:C:\\Messages\\Outbox")

The include option ignores all files without a .gz extension.

The issue im having is if a file comes in with a .gz extension but is not
really a gzip file (i.e. a .txt file that i've manully rename the extension
to .gz) then camel throws an exception as follows:

[C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
attempt: 0 caught: java.io.IOException: Not in GZIP format
[C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
attempt: 1 caught: java.io.IOException: Not in GZIP format
[C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
attempt: 2 caught: java.io.IOException: Not in GZIP format
[C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
attempt: 3 caught: java.io.IOException: Not in GZIP format
[C:%5CMessages%5CTransportInbox] GenericFileOnCompletionWARN  Caused
by: [org.apache.camel.component.file.GenericFileOperationFailedException -
Error renaming file from C:\Messages\TransportInbox\invalid_gzip_test9.gz to
C:\Messages\TransportInbox\.camel\invalid_gzip_test9.gz]
org.apache.camel.component.file.GenericFileOperationFailedException: Error
renaming file from C:\Messages\TransportInbox\invalid_gzip_test9.gz to
C:\Messages\TransportInbox\.camel\invalid_gzip_test9.gz
at
org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:72)
at
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:107)
at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:86)
at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:132)
at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)
at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:53)
at
org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:55)
at 
org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:226)
at
org.apache.camel.processor.UnitOfWorkProcessor.doneUow(UnitOfWorkProcessor.java:199)
at
org.apache.camel.processor.UnitOfWorkProcessor.access$000(UnitOfWorkProcessor.java:37)
at
org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:157)
at
org.apache.camel.processor.RouteContextProcessor$1.done(RouteContextProcessor.java:56)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:106)
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:336)
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:

Re: building route in java dsl

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 10:12 AM, kiranreddykasa  wrote:
>
> Can anyone tell me how to build camel route dynamically in dsl.
>
> I am aware of recepientlist, dynamic router.
>
> Suppose I have a list of endpoint url's, how can i build route by iterating
> the list ??
>
> List listOfEndpoints=
>
> In Route builder configure method can i define a single route in multiple
> steps???
>
> for eg..
>
> from(listOfEndpoints.get(0));
> iterating
>   to(listOfEndpoints.get(..));
>
>
> something like  this??
>

Yeah remember its just Java code. So you can use for loops / if ..
else constructs etc.

But you would need to use variables to break up the DSL and add to it later.

See this unit test for an example
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/management/BigRouteTest.java



>
>
>
>
> -
> Regards
>
> kiran Reddy
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/building-route-in-java-dsl-tp5727483.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: DestinationResolver for Reply Messages

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 12:32 PM, prueegg  wrote:
> I need to connect to WebSphere MQ and set the correct header fields in the
> WMQ message header.
>
> This works fine for simple fire&forget as well as for request messages since
> I'm using a DestinationResolver to set all the required poperties to the
> destination.
>
> public Destination resolveDestinationName(Session session, String
> destinationName, boolean isPubSubDomain) throws JMSException {
> LOGGER.debug("Resolve Destination Name: " + destinationName);
> Destination destination = super.resolveDestinationName(session,
> destinationName, isPubSubDomain);
> if (destination instanceof MQDestination) {
> MQDestination mqDestination = (MQDestination) destination;
> mqDestination.setEncoding(getEncoding());
> mqDestination.setFailIfQuiesce(getFailIfQuiesce());
> mqDestination.setTargetClient(getTargetClient());
> mqDestination.setMQMDWriteEnabled(true);
> mqDestination.setMQMDReadEnabled(true);
>
> mqDestination.setMQMDMessageContext(CommonConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);
> mqDestination.setPriority(CommonConstants.WMQ_PRI_QDEF);
> mqDestination.setPersistence(CommonConstants.WMQ_PER_QDEF);
> // mqDestination.setExpiry(CommonConstants.WMQ_EXP_UNLIMITED);
> }
> return destination;
> }
>
> The problem is, that the destination resolver is not called for the replyTo
> destination given by the WMQ message.
>
> How can I apply the properties mentioned above also for the replyTo
> destination?
>

What version of Camel do you use?


> Patrick
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/DestinationResolver-for-Reply-Messages-tp5727490.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: How to handle error when - Renaming file from: *** failed due cannot delete from file

2013-02-13 Thread Claus Ibsen
Hi

You should use the deadLetterChannel as the error handler.
errorHandler(deadLetterChannel("...")...



On Wed, Feb 13, 2013 at 2:06 PM, briane80  wrote:
> Hi,
>
> I'm using camel 2.10.3 on windows 7.
>
> I have a route set up as follows:
>
> errorHandler("file:C:\\Errors").maximumRedeliveries(3).redeliveryDelay(5000).retryAttemptedLogLevel(LoggingLevel.WARN).useOriginalMessage());
>
> from("file:C:\\Messages\\Inbox?consumer.delay=5000&include=.*.gz").unmarshal().gzip().to("file:C:\\Messages\\Outbox")
>
> The include option ignores all files without a .gz extension.
>
> The issue im having is if a file comes in with a .gz extension but is not
> really a gzip file (i.e. a .txt file that i've manully rename the extension
> to .gz) then camel throws an exception as follows:
>
> [C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
> delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
> ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
> attempt: 0 caught: java.io.IOException: Not in GZIP format
> [C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
> delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
> ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
> attempt: 1 caught: java.io.IOException: Not in GZIP format
> [C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
> delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
> ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
> attempt: 2 caught: java.io.IOException: Not in GZIP format
> [C:%5CMessages%5CTransportInbox] DeadLetterChannel  WARN  Failed
> delivery for (MessageId: ID-DT-013BG-005752-52292-1360760432044-0-1 on
> ExchangeId: ID-DT-013BG-005752-52292-1360760432044-0-2). On delivery
> attempt: 3 caught: java.io.IOException: Not in GZIP format
> [C:%5CMessages%5CTransportInbox] GenericFileOnCompletionWARN  Caused
> by: [org.apache.camel.component.file.GenericFileOperationFailedException -
> Error renaming file from C:\Messages\TransportInbox\invalid_gzip_test9.gz to
> C:\Messages\TransportInbox\.camel\invalid_gzip_test9.gz]
> org.apache.camel.component.file.GenericFileOperationFailedException: Error
> renaming file from C:\Messages\TransportInbox\invalid_gzip_test9.gz to
> C:\Messages\TransportInbox\.camel\invalid_gzip_test9.gz
> at
> org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:72)
> at
> org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:107)
> at
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:86)
> at
> org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:132)
> at
> org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)
> at
> org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:53)
> at
> org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:55)
> at 
> org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:226)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.doneUow(UnitOfWorkProcessor.java:199)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.access$000(UnitOfWorkProcessor.java:37)
> at
> org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:157)
> at
> org.apache.camel.processor.RouteContextProcessor$1.done(RouteContextProcessor.java:56)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:106)
> at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(

Re: How to handle error when - Renaming file from: *** failed due cannot delete from file

2013-02-13 Thread briane80
Hi Claus,

Sorry there was an error in the text a copied over - I am using the
deadLetterChannel as follows and get the problem:

errorHandler(deadLetterChannel("file:C:\\Errors")).maximumRedeliveries(3).redeliveryDelay(5000).retryAttemptedLogLevel(LoggingLevel.WARN).useOriginalMessage());

from("file:C:\\Messages\\Inbox?consumer.delay=5000&include=.*.gz").unmarshal().gzip().to("file:C:\\Messages\\Outbox")
 



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-handle-error-when-Renaming-file-from-failed-due-cannot-delete-from-file-tp5727493p5727500.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Dynamic XSL source - with 2.8.6

2013-02-13 Thread sammm
I have a route in version 2.9 which uses CamelXsltResourceUri to dynamically
control the name of the XSL to use in an 'xslt' endpoint.

However i need to get it working in 2.8.5 (as it needs to be integrated into
a particular version of ServiceMix/Fuse).

i can't see a way (short of writing my own component) to acheive the same
with any form of replacement variables.

Any ideas or solutions?

Martin



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread sammm
i should also say that the route/context etc is specified with Spring XML.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727502.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to handle error when - Renaming file from: *** failed due cannot delete from file

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 2:59 PM, briane80  wrote:
> Hi Claus,
>
> Sorry there was an error in the text a copied over - I am using the
> deadLetterChannel as follows and get the problem:
>
> errorHandler(deadLetterChannel("file:C:\\Errors")).maximumRedeliveries(3).redeliveryDelay(5000).retryAttemptedLogLevel(LoggingLevel.WARN).useOriginalMessage());
>
> from("file:C:\\Messages\\Inbox?consumer.delay=5000&include=.*.gz").unmarshal().gzip().to("file:C:\\Messages\\Outbox")
>

I think you have hit a file being locked issue on Windows due the gzip
unmarshal may have a file input stream being not closed.

You can convert the message to a String / byte[] before unmarshal to
avoid this problem

from file
  convertBodyTo(byte[].class)
  unmarshal



>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-handle-error-when-Renaming-file-from-failed-due-cannot-delete-from-file-tp5727493p5727500.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


how to set body clipped length on traceer using jmx

2013-02-13 Thread Preben.Asmussen
hi

I have turned tracing on using jmx. Set tracing to true on the Route. 

The trace body however is clipped after 1000 chars

In the log -> [Body clipped after 1000 chars, total length is 3253]]

How can I change that using jmx so I get the full trace payload ?

Best
Preben



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-set-body-clipped-length-on-traceer-using-jmx-tp5727504.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 3:06 PM, sammm  wrote:
> i should also say that the route/context etc is specified with Spring XML.
>

Maybe this FAQ can help
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html


>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727502.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: how to set body clipped length on traceer using jmx

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 3:16 PM, Preben.Asmussen  wrote:
> hi
>
> I have turned tracing on using jmx. Set tracing to true on the Route.
>
> The trace body however is clipped after 1000 chars
>
> In the log -> [Body clipped after 1000 chars, total length is 3253]]
>
> How can I change that using jmx so I get the full trace payload ?
>

Yeah usually with Camel there is an option for that :)
http://camel.apache.org/how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html


> Best
> Preben
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-set-body-clipped-length-on-traceer-using-jmx-tp5727504.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


ExchangeHelper.copyResults(...) doesn't copy exchange pattern

2013-02-13 Thread Marek Pszczolka
Why ExchangeHelper.copyResults(Exchange, Exchange) method doesn't copy
exchange pattern from the source exchange? By default it is InOnly.

The following junit fails:

Exchange source = new DefaultExchange(context, 
ExchangePattern.InOut);
source.getIn().setBody("source body");

Exchange copy = new DefaultExchange(context, 
ExchangePattern.InOnly);
copy.getIn().setBody("copy body");

ExchangeHelper.copyResults(copy, source);

assertTrue(copy.getIn().getBody().equals("source body"));
assertTrue(copy.getPattern().equals(ExchangePattern.InOut));   //
fails! pattern is still InOnly

Old copying method: "ex.copyFrom(exchange);"  copied also exchange pattern
to from exchange.

I'm using Camel 2.7.2, but I don't see any changes in 2.9.0 in that area.




--
View this message in context: 
http://camel.465427.n5.nabble.com/ExchangeHelper-copyResults-doesn-t-copy-exchange-pattern-tp5727506.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ExchangeHelper.copyResults(...) doesn't copy exchange pattern

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 3:21 PM, Marek Pszczolka  wrote:
> Why ExchangeHelper.copyResults(Exchange, Exchange) method doesn't copy
> exchange pattern from the source exchange? By default it is InOnly.
>

Because it copies the result which is the body + headers etc.


> The following junit fails:
>
> Exchange source = new DefaultExchange(context, 
> ExchangePattern.InOut);
> source.getIn().setBody("source body");
>
> Exchange copy = new DefaultExchange(context, 
> ExchangePattern.InOnly);
> copy.getIn().setBody("copy body");
>
> ExchangeHelper.copyResults(copy, source);
>
> assertTrue(copy.getIn().getBody().equals("source body"));
> assertTrue(copy.getPattern().equals(ExchangePattern.InOut));   //
> fails! pattern is still InOnly
>
> Old copying method: "ex.copyFrom(exchange);"  copied also exchange pattern
> to from exchange.
>
> I'm using Camel 2.7.2, but I don't see any changes in 2.9.0 in that area.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ExchangeHelper-copyResults-doesn-t-copy-exchange-pattern-tp5727506.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: how to set body clipped length on traceer using jmx

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 3:29 PM, Preben.Asmussen  wrote:
> But is it also possible to change this at runtime using jmx in the same way
> you can turn tracing on off ?
>

No this is not possible.

Well you can change the value on the getProperties on the CamelContext
at runtime. But there is no JMX API for that.


>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-set-body-clipped-length-on-traceer-using-jmx-tp5727504p5727508.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: How add a property ?

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 12:17 PM, anakin59490  wrote:
> hello,
>
> I would like to add a property in the file which is defined in my
> camelContext :
>

So you want to add a property to a file? And you cannot just do that
by opening the file in an editor and add the text?
If not you can use Java API to append to the file.

If you use camel-test kit you can use the function -
useOverridePropertiesWithPropertiesComponent - to add the property
from your unit test source code. See more details at the following
links
http://camel.apache.org/camel-test.html
http://camel.apache.org/properties.html


> 
> location="classpath:META-INF/camel/configuration_dev.properties,classpath:META-INF/camel/filtersDefinition_dev.properties"/>
>
> In my filtersDefinition_dev.properties file, i wrote :
> sepa.splitter=test
>
> and i would like to add a new property : sepa.splitter2=test2
>
> I try to do that in a bean :
>
> @Resource(name="properties")
> protected CamelPropertyPlaceholderDefinition filters;
>
>
> but i don't find the equivalent of setProperty (java.util.Properties)
> method.
>
>
> Why do i want to add it in filterDefinition_dev.properties ?
>
> Because i would like to use this new property in a camel route like this :
>
> from("direct:transformXML")
>  .beanRef("myClass", "myMethod")  -> create the new property
> (sepa.splitter2=test2)
>  .split().tokenizeXML("{{sepa.splitter2}"}
>
>
> I don't find example on the web
>
> Can you help me ?
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-add-a-property-tp5727488.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread sammm
Claus,

thanks for that - i'd seen it and hoped it would do what i wanted but if
errored in use.

If i do this:

  
  concat('META-INF/xsl/',local-name(/*[local-name(.)='Envelope']/*[local-name(.)='Body']/*),'.xsl')
  
  

When i run the route (using 'camel:run' with maven) i get a
BeanDefinitionStoreException:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from file
[c:\dev\Workspaces\camel-rxservices\target\classes\META-INF\spring\camel-context.xml];
nested exception is 
java.lang.NullPointerException
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)

i.e. its erroring as it's trying to replace the header ref - is there a way
to do this in XML config or does it need to be dne via Java DSL?

Thanks

Martin




--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727513.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 3:51 PM, sammm  wrote:
> Claus,
>
> thanks for that - i'd seen it and hoped it would do what i wanted but if
> errored in use.
>
> If i do this:
>
>   
>resultType="java.lang.String">concat('META-INF/xsl/',local-name(/*[local-name(.)='Envelope']/*[local-name(.)='Body']/*),'.xsl')
>   
>   
>
> When i run the route (using 'camel:run' with maven) i get a
> BeanDefinitionStoreException:
>
> Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
> Unexpected exception parsing XML document from file
> [c:\dev\Workspaces\camel-rxservices\target\classes\META-INF\spring\camel-context.xml];
> nested exception is
> java.lang.NullPointerException
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
>
> i.e. its erroring as it's trying to replace the header ref - is there a way
> to do this in XML config or does it need to be dne via Java DSL?
>

This is another kind of error. Make sure to use same version of Camel
and Spring in the  classpath.
And also mind if you add JAXB on the classpath, then there is a 2.2
for Java7 and 2.1 for Java6 etc.



> Thanks
>
> Martin
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727513.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: ExchangeHelper.copyResults(...) doesn't copy exchange pattern

2013-02-13 Thread Marek Pszczolka
Thanks for quick response.

We had something like this and it worked correctly:

newExchange = template.send("direct:...", new
Processor() { 
public void process(Exchange ex) throws
Exception {
ex.copyFrom(exchange);
}
});

Now, because of copyFrom() is removed, I wanted to use this code but it
didn't work as expected:

newExchange = template.send("direct:...", new
Processor() { 
public void process(Exchange ex) throws
Exception {
ExchangeHelper.copyResults(ex, exchange);
}
});

Am I using something incorrectly?

With ex.setPattern(ExchangePattern.InOut); my routes work as expected.

Thanks,
Marek




--
View this message in context: 
http://camel.465427.n5.nabble.com/ExchangeHelper-copyResults-doesn-t-copy-exchange-pattern-tp5727506p5727514.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 3:54 PM, Claus Ibsen  wrote:
> On Wed, Feb 13, 2013 at 3:51 PM, sammm  wrote:
>> Claus,
>>
>> thanks for that - i'd seen it and hoped it would do what i wanted but if
>> errored in use.
>>
>> If i do this:
>>
>>   
>>   > resultType="java.lang.String">concat('META-INF/xsl/',local-name(/*[local-name(.)='Envelope']/*[local-name(.)='Body']/*),'.xsl')
>>   
>>   
>>
>> When i run the route (using 'camel:run' with maven) i get a
>> BeanDefinitionStoreException:
>>
>> Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
>> Unexpected exception parsing XML document from file
>> [c:\dev\Workspaces\camel-rxservices\target\classes\META-INF\spring\camel-context.xml];
>> nested exception is
>> java.lang.NullPointerException
>> at
>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
>>
>> i.e. its erroring as it's trying to replace the header ref - is there a way
>> to do this in XML config or does it need to be dne via Java DSL?
>>
>
> This is another kind of error. Make sure to use same version of Camel
> and Spring in the  classpath.
> And also mind if you add JAXB on the classpath, then there is a 2.2
> for Java7 and 2.1 for Java6 etc.
>

Ah mind that Camel 2.9 does not support Java7. So you need to use Java6.

Camel 2.10 onwards support Java 7.


>
>
>> Thanks
>>
>> Martin
>>
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727513.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread sammm
ok - i'll track that down.

So, should:



work as a dynamic reference?

Martin



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727517.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread Claus Ibsen
On Wed, Feb 13, 2013 at 3:58 PM, sammm  wrote:
> ok - i'll track that down.
>
> So, should:
>
> 
>
> work as a dynamic reference?
>

No see the FAQ


> Martin
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727517.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: DestinationResolver for Reply Messages

2013-02-13 Thread prueegg
btw. I think the problem is that the destination for reply is directly read
from the JMS Message in the JmsMessageHelper with
message.getJMSReplyTo();

This destination (instanceof Destination) could be directly used to send the
reply without the DestinationResolver. The DestinationResolver is only
required if the destination is not instanceof Destination.

Unfortunatelly the getJMSReplyTo doesn't apply all the properties to the
destination as the listener (receiving the request) has got.

Do I have to consider to have a own JmsConfiguration class which overrides
the CamelJmsTemplate to have a direct influence on the properties just
before the actual send (of the reply) is done?



--
View this message in context: 
http://camel.465427.n5.nabble.com/DestinationResolver-for-Reply-Messages-tp5727490p5727519.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ExchangeHelper.copyResults(...) doesn't copy exchange pattern

2013-02-13 Thread Claus Ibsen
Hi

Why do you use those inlined processors to send a copy of an exchange?
Can't you just copy the exchange?

newExchange = template.send("direct:...", exchange.copy());


On Wed, Feb 13, 2013 at 3:53 PM, Marek Pszczolka  wrote:
> Thanks for quick response.
>
> We had something like this and it worked correctly:
>
> newExchange = template.send("direct:...", new
> Processor() {
> public void process(Exchange ex) throws
> Exception {
> ex.copyFrom(exchange);
> }
> });
>
> Now, because of copyFrom() is removed, I wanted to use this code but it
> didn't work as expected:
>
> newExchange = template.send("direct:...", new
> Processor() {
> public void process(Exchange ex) throws
> Exception {
> ExchangeHelper.copyResults(ex, exchange);
> }
> });
>
> Am I using something incorrectly?
>
> With ex.setPattern(ExchangePattern.InOut); my routes work as expected.
>
> Thanks,
> Marek
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ExchangeHelper-copyResults-doesn-t-copy-exchange-pattern-tp5727506p5727514.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Dynamic XSL source - with 2.8.6

2013-02-13 Thread sammm
Bingo!
1. used recipientList (should reach the FAQ more carefully) and 
2. set some more versions for jaxb etc which got rid of the bind error.

Many Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-XSL-source-with-2-8-6-tp5727501p5727521.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SJMS and InOut

2013-02-13 Thread Scott England-Sullivan
Thanks for the clarification Claus. I will update the documentation and plan 
for an update in a later release. 

Best Regards,
Scott ES


On Feb 13, 2013, at 12:59 AM, Harald Wellmann  wrote:

> Well, it should be clearly documented that inOut() does not have the
> desired effect and that camel-sjms behaves differently than camel-jms
> in this respect.
> 
> I can live with the current approach, and I'm eager to see a release
> of camel-sjms in 2.11 to get rid of the transitive Spring dependency
> in my Java EE app which is not required except by camel-jms.
> 
> But it would be useful to remove that restriction in the next release.
> 
> We use bean invocations tunnelled through JMS a lot, and it should be
> possible to have InOut methods and InOnly methods in the same service
> interface, tunneled through the same queue.
> 
> Best regards,
> Harald


Re: How to handle error when - Renaming file from: *** failed due cannot delete from file

2013-02-13 Thread briane80
Converting to the byte array has worked thanks for the quick reply.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-handle-error-when-Renaming-file-from-failed-due-cannot-delete-from-file-tp5727493p5727525.html
Sent from the Camel - Users mailing list archive at Nabble.com.


URL overwriting - SOAP vs restful

2013-02-13 Thread jdev.hari
Hi,

I define my end point in camel context xml and during runtime I override
them as I get it from a Service catalogue service.

For SOAP webservice invocations, I am able to do the following in a
processor just before the cxf bean invocation.

Map requestContext = new HashMap();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,endPointURL);
exchange.getOut().setHeader(Client.REQUEST_CONTEXT, requestContext);

And this works as well. However if I try to do the same with restful
services. I get the following error (note, without overriding the call goes
through fine with restful services)

Caused by: org.apache.camel.component.cxf.CxfOperationException: JAXRS
operation failed invoking direct://matching with statusCode: 404
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.populateCxfRsProducerException(CxfRsProducer.java:317)
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:177)
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:87)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

I turned on the outgoing Webservice logging interceptor and I see the
following

 INFO  : Outbound Message
---
ID: 4
Address: http://localhost:9084/yyy/services/ABC
Content-Type: */*
Headers:
{RequestContext=[{javax.xml.ws.service.endpoint.address=http://xxx:9080/yyy/services/ABC}],
Content-Type=[*/*], Connection=[Keep-Alive], Accept=[*/*]}
--


The URL http://locahost:9084/yyy/services/ABC is present in camel endpoint
xml, whereas http://xxx:9080/yyy/services/ABC is the URL that needs to be
overridden.

The same service if I model as SOAP based, the url overwriting works well.
The outgoing request was 


INFO  : Outbound Message
---
ID: 2
Address: http://XXX:9080/yyy/services/ABC
Encoding: UTF-8
Content-Type: text/xml
Headers: {Accept=[*/*], Connection=[Keep-Alive], SOAPAction=[""]}
Payload: http://schemas.xmlsoap.org/soap/envelope/";>..content
removed for brevity...
--

Any inputs on this.

Regards,
Hari




--
View this message in context: 
http://camel.465427.n5.nabble.com/URL-overwriting-SOAP-vs-restful-tp5727526.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SJMS and InOut

2013-02-13 Thread Scott England-Sullivan
Harald,

First, thanks again for your feedback. I will update the documentation with a 
warning clarifying the limitation. 

If you could clarify your use case for me, is this a one to many configuration? 
 One endpoint definition to many routes?

Thanks again,
Scott ES


On Feb 13, 2013, at 12:59 AM, Harald Wellmann  wrote:

> Well, it should be clearly documented that inOut() does not have the
> desired effect and that camel-sjms behaves differently than camel-jms
> in this respect.
> 
> I can live with the current approach, and I'm eager to see a release
> of camel-sjms in 2.11 to get rid of the transitive Spring dependency
> in my Java EE app which is not required except by camel-jms.
> 
> But it would be useful to remove that restriction in the next release.
> 
> We use bean invocations tunnelled through JMS a lot, and it should be
> possible to have InOut methods and InOnly methods in the same service
> interface, tunneled through the same queue.
> 
> Best regards,
> Harald


Re: URL overwriting - SOAP vs restful

2013-02-13 Thread Sergey Beryozkin

Hi,
On 13/02/13 15:45, jdev.hari wrote:

Hi,

I define my end point in camel context xml and during runtime I override
them as I get it from a Service catalogue service.

For SOAP webservice invocations, I am able to do the following in a
processor just before the cxf bean invocation.

Map  requestContext = new HashMap();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,endPointURL);
exchange.getOut().setHeader(Client.REQUEST_CONTEXT, requestContext);

And this works as well. However if I try to do the same with restful
services. I get the following error (note, without overriding the call goes
through fine with restful services)

BindingProvider.ENDPOINT_ADDRESS_PROPERTY is not recognized by the 
client RS runtime, can you try


final String REQUEST_URI = "org.apache.cxf.request.uri";
exchange.getOut().setHeader(REQUEST_URI, endPointURL);

Not sure if it will work in Camel right now, though I'm pretty sure we 
have a CXF test for changing the original address, let me know please


Cheers, Sergey


Caused by: org.apache.camel.component.cxf.CxfOperationException: JAXRS
operation failed invoking direct://matching with statusCode: 404
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.populateCxfRsProducerException(CxfRsProducer.java:317)
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:177)
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:87)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

I turned on the outgoing Webservice logging interceptor and I see the
following

  INFO  : Outbound Message
---
ID: 4
Address: http://localhost:9084/yyy/services/ABC
Content-Type: */*
Headers:
{RequestContext=[{javax.xml.ws.service.endpoint.address=http://xxx:9080/yyy/services/ABC}],
Content-Type=[*/*], Connection=[Keep-Alive], Accept=[*/*]}
--


The URL http://locahost:9084/yyy/services/ABC is present in camel endpoint
xml, whereas http://xxx:9080/yyy/services/ABC is the URL that needs to be
overridden.

The same service if I model as SOAP based, the url overwriting works well.
The outgoing request was


INFO  : Outbound Message
---
ID: 2
Address: http://XXX:9080/yyy/services/ABC
Encoding: UTF-8
Content-Type: text/xml
Headers: {Accept=[*/*], Connection=[Keep-Alive], SOAPAction=[""]}
Payload:http://schemas.xmlsoap.org/soap/envelope/";>..content
removed for brevity...
--

Any inputs on this.

Regards,
Hari




--
View this message in context: 
http://camel.465427.n5.nabble.com/URL-overwriting-SOAP-vs-restful-tp5727526.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: default maximum redelivery policy when overridding default error handler not right

2013-02-13 Thread boday
adding logStrackTrace(false) had no effect on my unit test...still works as
expected (tried against 2.10 and against the latest trunk)...

public class RedeliverTest extends ContextTestSupport
{

public void testRedeliver() throws Exception {
template.sendBody("direct:start", "Hello World");
getMockEndpoint("mock:b").setExpectedMessageCount(0);
assertMockEndpointsSatisfied();
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {

onException(IOException.class)
.handled(true)
.logStackTrace(false)
.maximumRedeliveries(3)
.to("log:CONTEXT-ERROR");

from("direct:start")
.onException(IOException.class)
//.maximumRedeliveries(3)
.logStackTrace(false)
.handled(true)
.to("log:ROUTE-ERROR")
.end()
.to("log:TRYING")
.process(new MyProcessor())
.to("mock:b");
}
};
}

public static class MyProcessor implements Processor {

private int counter;

@Override
public void process(Exchange exchange) throws Exception {
System.out.println("trying->" + exchange.getExchangeId());
if (counter++ < 2) {
throw new IOException("Forced");
}
exchange.getIn().setBody("Bye World");
}
}
}


joe82 wrote
> Thanks for reply -
> Ok, so on trying to replicate this myself in a unit test, I discovered the
> exact scenario that causes this...
> If you add the .logStackTrace(true/false) to your onException(...) policy,
> then you will see the context scoped maxRedeliveryAttempts value applied.
> So the below route-scoped exception policy is picking up the
> context-scoped error policy redelivery value (defined as 3):
> 
> from("direct:testscope")
> .onException(Exception.class)
> .handled(true)
> .logStackTrace(false)
> .to("mock:exception")
> .end()
> 
> But omitting the .logStackTrace(..) like below, picks up the expected
> default redelivery attempts of 0.
> 
> from("direct:testscope")
> .onException(Exception.class)
> .handled(true)
> .to("mock:exception")
> .end()
> 
> Do you find same if you add this to your route policy?
> 
> Regards,
> joanne
> 
> 
> From: boday [via Camel] [mailto:

> ml-node+s465427n5727441h63@.nabble

> ]
> Sent: 12 February 2013 16:51
> To: Gilmore, Joanne
> Subject: Re: default maximum redelivery policy when overridding default
> error handler not right
> 
> I just created a basic test and it seemed to work fine for my scenario. 
> Can you attach a unit test that replicates this?
> joe82 wrote
> According the the camel documentation, if you provide a context-scoped
> error handling policy, and then a route-scoped onException policy also -
> the MaximumRedeliveries for the route-scoped policy should default to 0
> regardless of whether or not your context-scoped error handling policy had
> overwitten it.
> This does not appear to be correct, as I have found in this scenario, the
> MaximumRedeliveries default on my route-scoped onException policy was
> picking up the value which I had defined in the context-scoped error
> handling policy which was 3, instead of what I expected it to be (0).
> So I had to explicitly set the MaximumRedeliveries on the route-scoped
> policy to be 0.
> The version of camel for this project is 2.10.2.
> 
> Has anyone noticed this? has it been raised with camel?
> Ben O'Day
> IT Consultant -http://consulting-notes.com
> 
> 
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/default-maximum-redelivery-policy-when-overridding-default-error-handler-not-right-tp5727230p5727441.html
> To unsubscribe from default maximum redelivery policy when overridding
> default error handler not right, click
> here;.
> NAML;





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in conte

Re: URL overwriting - SOAP vs restful

2013-02-13 Thread jdev.hari
Hi,

I tried it, I still get the same error.

Caused by: org.apache.camel.component.cxf.CxfOperationException: JAXRS
operation failed invoking direct://matching with statusCode: 404
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.populateCxfRsProducerException(CxfRsProducer.java:317)
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:177)
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:87)


The outgoing XML message was

 INFO  : Outbound Message
---
ID: 4
Address: http://localhost:9080/yyy/services/ABC
Content-Type: */*
Headers: {org.apache.cxf.request.uri=[http://XXX:9080/yyy/services/ABC],
Content-Type=[*/*], Connection=[Keep-Alive], Accept=[*/*]}
--

I believe still the request goes to localhost instead of going to XXX

Regards,
Hari




--
View this message in context: 
http://camel.465427.n5.nabble.com/URL-overwriting-SOAP-vs-restful-tp5727526p5727530.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using Dead letter channel with ActiveMQ?

2013-02-13 Thread dunnlow
Claus, I've tried to avoid this issue, but it is back upon me.  

Basically, I'm using camel 2.10.3 now, Spring 3.1.2 and activemq 5.7) I am
consuming from an activemq broker which I do not control, and which does not
allow use of a DLQ - it is clustered, robust, etc, etc.  I want to make sure
that my route is successful before it is permanently removed from the queue. 
Currently, I use the Spring JmsTransactionManager with an activemq
RedeliveryPolicy.   However, this requests the creation of a DLQ after the
maximum delivery tries (which make the broker owners surly because they see
errors).

I am looking for the best strategy to handle this.  I've considered putting
a camel redelivery policy on top with one less retry (so that it sent the
msg to a dead letter channel before the last Spring retry).  I also
considered pulling the message off the queue and stuffing it somewhere
locally - but this is adding another point of failure.

Any other thoughts about how to take over the the dead letter channel so
that the message stays on the queue until either the route succeeds OR the
max retries is reached (and then stored locally to a file)?

Thanks for any thoughts,
-J



--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-Dead-letter-channel-with-ActiveMQ-tp5723865p5727531.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: VM Queues Disconnected after Karaf Bundle Update

2013-02-13 Thread Henryk Konsek
> Found the issue that causes VM producer and consumer to "disconnect" in an
> OSGi environment when a bundle is restarted.

Yeah, the fact that VM queues disconnects is apparently the bug. I
wanted to investigate it but you were first :) Thanks for taking look
at this.


-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: SJMS and InOut

2013-02-13 Thread Harald Wellmann
Scott,

basically, its one-to-one. Camel (S)JMS + Proxies + Beans (Spring or
EJB) is our standard remoting mechanism.

A client system has an outgoing route starting with a Camel proxy for FooService

  from("direct:fooProxy).to("sjms:queue:fooQueue")

and the server system has a corresponding incoming route

  from("sjms:queue:fooQueue).to("ejb:FooServiceImpl").

There is one queue for each service. At the moment each service
happens to be either fully InOnly or InOut, but it is very likely for
a service to have mix of InOnly and InOut methods, and some of the
InOut methods might by synchronous (returning T) and others
asynchronous (returning Future). So ideally, all these different
flavours of exchanges should be handled by the same SJMS endpoint, to
avoid splitting a service interface into several parts just because of
a restriction in the Camel infrastructure.

Hope that makes it clearer.

Best regards,
Harald


Re: URL overwriting - SOAP vs restful

2013-02-13 Thread Sergey Beryozkin

Actually, you mentioned that

>> Map requestContext = new HashMap();
>> 
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,endPointURL);

>>
>> exchange.getOut().setHeader(Client.REQUEST_CONTEXT, requestContext);

actually affects the RS path too - I can see WS & RS request context 
property is actually named identically (in CXF code). So give it another 
try with the above code but replace


requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,endPointURL);

with

requestContext.put("org.apache.cxf.request.uri",endPointURL);

and possibly add

requestContext.put(Message.ENDPOINT_ADDRESS,endPointURL);


if that does not work then then we can take it offline to minimize the 
noise - actually, if that does not work still - have a look in the 
debugger and make sure that whatever properties are set there which make 
the invocation work as expected are reset to the new values and not 
lost, AFAIK, CXF RS runtime has a default request context on the message 
already set...so may be you have to do


exchange.getOut().getHeader(Client.REQUEST_CONTEXT) and if the context 
is not null then update request uri and endpoint address on it


Cheers, Sergey

On 13/02/13 16:15, Sergey Beryozkin wrote:

Hi,
On 13/02/13 15:45, jdev.hari wrote:

Hi,

I define my end point in camel context xml and during runtime I override
them as I get it from a Service catalogue service.

For SOAP webservice invocations, I am able to do the following in a
processor just before the cxf bean invocation.

Map requestContext = new HashMap();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,endPointURL);

exchange.getOut().setHeader(Client.REQUEST_CONTEXT, requestContext);

And this works as well. However if I try to do the same with restful
services. I get the following error (note, without overriding the call
goes
through fine with restful services)


BindingProvider.ENDPOINT_ADDRESS_PROPERTY is not recognized by the
client RS runtime, can you try

final String REQUEST_URI = "org.apache.cxf.request.uri";
exchange.getOut().setHeader(REQUEST_URI, endPointURL);

Not sure if it will work in Camel right now, though I'm pretty sure we
have a CXF test for changing the original address, let me know please

Cheers, Sergey


Caused by: org.apache.camel.component.cxf.CxfOperationException: JAXRS
operation failed invoking direct://matching with statusCode: 404
at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.populateCxfRsProducerException(CxfRsProducer.java:317)

at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:177)

at
org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:87)

at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)


I turned on the outgoing Webservice logging interceptor and I see the
following

INFO : Outbound Message
---
ID: 4
Address: http://localhost:9084/yyy/services/ABC
Content-Type: */*
Headers:
{RequestContext=[{javax.xml.ws.service.endpoint.address=http://xxx:9080/yyy/services/ABC}],

Content-Type=[*/*], Connection=[Keep-Alive], Accept=[*/*]}
--


The URL http://locahost:9084/yyy/services/ABC is present in camel
endpoint
xml, whereas http://xxx:9080/yyy/services/ABC is the URL that needs to be
overridden.

The same service if I model as SOAP based, the url overwriting works
well.
The outgoing request was


INFO : Outbound Message
---
ID: 2
Address: http://XXX:9080/yyy/services/ABC
Encoding: UTF-8
Content-Type: text/xml
Headers: {Accept=[*/*], Connection=[Keep-Alive], SOAPAction=[""]}
Payload:http://schemas.xmlsoap.org/soap/envelope/";>..content

removed for brevity...
--

Any inputs on this.

Regards,
Hari




--
View this message in context:
http://camel.465427.n5.nabble.com/URL-overwriting-SOAP-vs-restful-tp5727526.html

Sent from the Camel - Users mailing list archive at Nabble.com.



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com


Re: Reference OSGI Blueprint java.util.Properties service in Blueprint Camel property placeholder

2013-02-13 Thread CharlieD
Willem, 

I did add: 

However it cannot resolve the property. It is as if it can find the service
yet the properties are not there.
Caused by: java.lang.IllegalArgumentException: Property with key
[customer.event.endpoint] not found in properties from text:
{{customer.event.endpoint}}


Claus, yes I am using two separate bundles.


In my Java/Blueprint solution I put something like this:



   


MyRoute extends RouteBuilder and has a class member named props.
  
   private Properties props;

   public Properties getProps() {
 return props;
   }

   public void setProps(Properties props) {
 this.props = props;
   }

I then have some code logic and this solution works as I mentioned in my
first post. I can use that but wanted to see if the communal genius knew of
a better way. What solutions are out there for shared properties so that the
only related bundles need restart? I'm looking for granularity of control.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Reference-OSGI-Blueprint-java-util-Properties-service-in-Blueprint-Camel-property-placeholder-tp5726985p5727538.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Help with mocking a filter bean method call

2013-02-13 Thread whelmingbytes
Hello,

I'm somewhat new to camel so sorry if I am not explaining the concepts very
well. I have a route that looks something like:

from('direct:start').filter().method('bean',
'matches').to('mock:endpoint').stop()

In my test, I am trying to mock out the method 'matches' call using mockito.
I have successfully mocked route beans before with:

routeDefinition.adviceWith(context,new AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
weaveById(camelId).replace().bean(bean, 'matches');
}
});

But, I am not sure how to go about swapping out my filters bean method call
with my mock. I have a gist here with a test if anyone is willing to take a
look or point me to some examples of this:

https://gist.github.com/whelmingbytes/446d0650b47ae082b626

Thanks!

-Spencer



--
View this message in context: 
http://camel.465427.n5.nabble.com/Help-with-mocking-a-filter-bean-method-call-tp5727543.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using Dead letter channel with ActiveMQ?

2013-02-13 Thread dunnlow
I have a solution that seems to be working.  I have assigned a context
errorHandler and have a deliverypolicy that has a dead letter uri (a route
that dumps to a file), like:








   
   
   



When a message fails 5 times (to test I am shutting down the web service, so
there is a connection exception thrown), it is routed to my "dumpToFile"
route.

I'm still using the Spring JmsTransactionManager in my JMS config for the
connection factory because if I don't and camel shuts down during the
retries, the message is lost (pulled off the queue).  

A few questions:

1) My ActiveMQ redeliveryPolicy seems to be getting ignored.  I believe that
the camel error handler is intercepting so that spring/activemq does not see
the rollback.  Does this seem correct?

2) Does anyone see any issues with this approach?

Claus, meant to mention, I never found a JMSRedeliveryCounter.

Thanks again,
-J



--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-Dead-letter-channel-with-ActiveMQ-tp5723865p5727544.html
Sent from the Camel - Users mailing list archive at Nabble.com.


MongoDB Jackson Date Mapping Option

2013-02-13 Thread Ron Anderson
The mongodb component is using the Jackson library for object mapping and has
mapping of dates defaulted to Unix timestamps rather than ISODate.  This
causes some problems with using the Aggregation Framework and makes queries
more difficult to view dates.

There is an option to set this default behavior using the following:

objectMapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS,
false);

Is there a way to get access to the Jackson ObjectMapper to set this option
during set up of the camel context etc?

thanks,

Ron



--
View this message in context: 
http://camel.465427.n5.nabble.com/MongoDB-Jackson-Date-Mapping-Option-tp5727548.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: MongoDB Jackson Date Mapping Option

2013-02-13 Thread Raul Kripalani
Hi Ron,

Not at the MongoDB component itself. We just provide this Object => JSON
conversion for convenience, not as a fully-fledged, flexible transformation
path.

That said, Camel provides a camel-jackson data format which is indeed more
flexible and supports injecting a custom ObjectMapper with your
configuration. So before sending to your MongoDB endpoint, you could ask
Camel to perform the JSON marshalling using the marshal() DSL. For example:

JacksonDataFormat jackson = new JacksonDataFormat(objectMapper, null);  //
use 'null' here as we won't be performing any unmarshalling with this data
format, otherwise indicate the unmarshal type, or HashMap.class otherwise

from("direct:foo").marshal(jackson).to("mongodb:...");


The MongoDB endpoint will detect the input to already be JSON and will
bypass the Object => JSON convenience conversion.

Hope that helps.

P.S.: Sorry for not replying to your private message earlier - today has
been hectic!

Regards,

*Raúl Kripalani*
Apache Camel Committer
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk 

On Wed, Feb 13, 2013 at 7:01 PM, Ron Anderson  wrote:

> The mongodb component is using the Jackson library for object mapping and
> has
> mapping of dates defaulted to Unix timestamps rather than ISODate.  This
> causes some problems with using the Aggregation Framework and makes queries
> more difficult to view dates.
>
> There is an option to set this default behavior using the following:
>
>
> objectMapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS,
> false);
>
> Is there a way to get access to the Jackson ObjectMapper to set this option
> during set up of the camel context etc?
>
> thanks,
>
> Ron
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/MongoDB-Jackson-Date-Mapping-Option-tp5727548.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Scala JAXB DSL

2013-02-13 Thread Henryk Konsek
> I used the following for my JaxbDataFormat and I guess this is the correct
> one as well.
>
> org.apache.camel.model.dataformat.JaxbDataFormat

Consider using org.apache.camel.converter.jaxb.JaxbDataFormat. "Model"
package is primarly intended to be used with Java and XML DSLs. You
probably just want to pass regular org.apache.camel.spi.DataFormat
instance to the "unmarshal" method.

import org.apache.camel.converter.jaxb.JaxbDataFormat
...
val jaxb = new JaxbDataFormat()
from(...).unmarshal(jaxb).to(...)

Of course you can still pass
org.apache.camel.model.dataformat.JaxbDataFormat to your Scala DSL (it
works for me). But org.apache.camel.converter.jaxb.JaxbDataFormat
would be more natural choice.

If you still encounter compilation error, send us minimal Maven
project which fails when compiling with 'mvn clean compile' and I'll
track the issue.

--
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Help with mocking a filter bean method call

2013-02-13 Thread Henryk Konsek
Hi Spencer,

Welcome to our community :) .

> from('direct:start').filter().method('bean',
> 'matches').to('mock:endpoint').stop()
>
> In my test, I am trying to mock out the method 'matches' call using mockito.

The approach of mine choice would be to register Mockito mock in the
Camel registry under the 'bean' name.

MyBean myBean = Mockito.mock(MyBean.class);
...
SimpleRegistry registry = new SimpleRegistry();
registry.put("bean", myBean);
CamelContext ctx = new DefaultCamelContext(registry);
...
ctx.createProducerTemplate().sendBody("direct:start", "Mockito FTW!");
...
Mockito.verify(myBean).matches();

AdviceWith seems to be a too big cannon for shooting the tiny little mock :) .

Best regards.

--
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Help with mocking a filter bean method call

2013-02-13 Thread whelmingbytes
Thanks for the quick reply!

This will work for this example, but I only created this example for
simplicity sake. In my actual test, my bean is loaded up with spring
component scan (most of the tests that use this are integration tests) and
the test is initialized with overriding the createApplicationContext()
method.

Can I replace a bean that is already in the context? We have large test
context file and without creating a new mocked one for my filter test, is
there any better way to do this? I was hoping to go down the path of using
advice like I do with our replace().bean() calls.

Thanks again!




--
View this message in context: 
http://camel.465427.n5.nabble.com/Help-with-mocking-a-filter-bean-method-call-tp5727543p5727552.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ExchangeHelper.copyResults(...) doesn't copy exchange pattern

2013-02-13 Thread Marek Pszczolka
I'm migrating our legacy code to new Camel so I would like to do only
absolutely required changes :)
That's why I used this existing inline copying processor.

You are right, send("direct:...", exchange.copy());  works fine.


I was mislead by other method
ExchangeHelper.copyResultsPreservePattern(...), which suggests that
copyResults(...) copies exchange pattern.
Maybe some clarification are required in this area.

Anyway, thanks for great support,
Marek



--
View this message in context: 
http://camel.465427.n5.nabble.com/ExchangeHelper-copyResults-doesn-t-copy-exchange-pattern-tp5727506p5727524.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to start a polling Timer route for each message received?

2013-02-13 Thread pmcb55
Hi,

I'm trying to implement a simple, but tricky little route!

For each message that arrives on a queue I want to kick-off a polling timer
to periodically check a specific database row for a 'safeToContinue' flag
changing value from 'false' to 'true'. Once the corresponding flag in the
database for that message changes to 'true' I want to stop that message's
polling job, and progress it's processing to the next stage of my pipeline.

In pseudo-camel code, I'd push into the following route a message whose body
is just a string that contains the primary Key of the database row
containing the 'safeToContinueFlag' value for that message:

from("direct://messagesWithDatabasePrimaryKeyValueInBody")
  .to("timer://foo?period=6")
  .setBody(constant("select safeToContinueFlag from tableX where primaryKey
= ") + constant(getIn().getBody()))
  .to("jdbc://testDB")
  .choice()
.when(body().isEqualTo("true"))
  .to(KILL THE POLLING TIMER JOB FOR THIS MESSAGE)
  .to("direct://nextPhaseOfMyPipeline");
.otherwise()
  // Continue polling until database flag changes to 'true'...
  .end();

How should this route be implemented...!?!?



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-start-a-polling-Timer-route-for-each-message-received-tp5727535.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel HTTP component timeout issue

2013-02-13 Thread cgsk
Hi there,

I am using camel http component for calling external webservice. For timeout
I am setting httpClient.soTimeout=1 as a query parameter in the service
url. But while testing the graceful degradation, we did dropped the response
packets from the service host as part of our testing and I could see in the
httpclient debug logs it does retries 3 times with a timeout of 20 secs and
it is the standard behaviour of HttpClient library. 

So eventually it exceeds my timeout of 10 secs. Why httpclient libraries
default behaviour of retrying is not getting overriden by soTimeout. Is
there a better way to disable retry through camel config. Please advise.


Regards,
CGSK



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-HTTP-component-timeout-issue-tp5727542.html
Sent from the Camel - Users mailing list archive at Nabble.com.


JMS using inOut, but expecting multiple responses?

2013-02-13 Thread Ian Vellosa
Hello. Please forgive me if this is a basic question, but I have been hunting
through the Camel documentation and patterns and not found what I’m looking
for. 

I have a JMS infrastructure which is passing messages between two systems. I
have created a simple camel route, something along the lines of:

from(jms:RequestSystemA).
inOut(jms:RequestSystemB?ReplyTo=ResponseSystemB).
to  (jms:ResponseSystemA);

(The actual route contains some processing along the way, but I left this
out for the sake of simplification)

This is working for my basic cases. However, when a request is sent to
system B, it sometime simply returns a response and other times will send
back multiple messages to say that the request is being processed, and then
at a later time the final response is sent. This whole process can take up
to a two minutes to complete. 

So what I would like is to create a route, something like:

Get message from system A and send it to system B.
Listen to a response from system B with a matching correlation ID.
if the response is a status update, send it to System A
But continue to listen for the next message (also possibly a status update)
If the message is the processing result, send that to system A
and end the job.

So maybe something like...

from( jms:RequestSystemA ).
inOut   ( jms:RequestSystemB?ReplyTo=ResponseSystemB ).
loop().while( messageType = statusUpdate ).
to ( jms:ResponseSystemA ).
from ( jms:ResponseSystemB ).
end ().
to  ( jms:ResponseSystemA );

Each of the status updates as well as the final response all come from
system B with the same correlation id. 

Is something like this possible?

Thanks for any assistance.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-using-inOut-but-expecting-multiple-responses-tp5727561.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Always receive String Message even with jmsMessageType set to Bytes

2013-02-13 Thread yxzhao
Hi All,

We have a route which gets messages from an MQ queue. We expect messages in
bytes, but always receive java.lang.String even when we set our route as
below:

 
 

 
 

Does anybody have a clue what we did wrong or missing?

Thanks in advance for any help or hints on this issue.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Always-receive-String-Message-even-with-jmsMessageType-set-to-Bytes-tp5727563.html
Sent from the Camel - Users mailing list archive at Nabble.com.