Re: [Camel + Websphere MQ ] How to send MQRFH2 properties and ReplyToQ

2013-11-07 Thread David Karlsen
Hi.

Try using this custom implementation of a Spring DestinationResolver which
I attached this JIRA:
https://jira.springsource.org/browse/SPR-3614 - works for me.

Certain MQMD fields are mapped into a JMS set of properties, see:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=%2Fcom.ibm.mq.csqzaw.doc%2Fuj25450_.htm




2013/11/7 Rachit Gandhi 

> Hi All,
>
> I am trying to set MQRFH2 properties (usr proeprties ) using Camel. But
> When the message arrives on the queue the properties are not set.
>
> In the code below I am trying to set a string property and its value  (i.e.
> foo = bar ), but the property is not set when massage arrives on the Queue.
>
> Also, the queue name for Reply To is not set.
>
> I also noticed, when the message arrives on the queue, the MQMD format is
> empty.
>
> Can someone give me some ideas on how to do this in Camel.
>
>
> http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.javadoc.doc%2FWMQJMSClasses%2Fcom%2Fibm%2Fmq%2Fjms%2FMQConnectionFactory.html
>
>
>
>
> Here is the code.
>
>
> import java.io.File;
>
> import javax.jms.JMSException;
>
> import junit.framework.TestCase;
>
> import org.apache.camel.CamelContext;
> import org.apache.camel.ProducerTemplate;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.jms.JmsComponent;
> import org.apache.camel.impl.DefaultCamelContext;
> import org.junit.Test;
>
> import com.ibm.mq.jms.MQConnectionFactory;
>
> public class MqPropertiesTest extends TestCase {
>
>  @Test
>  public void testMe() throws Exception{
>
> CamelContext context = new
> DefaultCamelContext();
> context.addComponent("wmq",
> JmsComponent.jmsComponent(createWMQ()));
> context.addRoutes(createRouteBuilder());
>
> context.start();
>
> File file = new File("myDataFile");
>
> ProducerTemplate template =
> context.createProducerTemplate();
>
> template.sendBody("direct:start", file);
>  }
>
>protected RouteBuilder createRouteBuilder() throws
> Exception {
>return new RouteBuilder() {
>@Override
>public void configure() throws Exception {
>
>
>  from( "direct:start" )
>
> .setHeader("CamelJmsDestinationName",
> constant("queue:///MY.QUEQE?targetClient=1"))
>
> *.setHeader("JMSReplyTo",constant("MY.REPLY.TO.Q"))*
>
> .to("wmq:queue:MY.QUEUE");
>
>
>
>}
>};
>}
>
>   public static
> com.ibm.mq.jms.MQConnectionFactory createWMQ() throws JMSException {
>
>  MQConnectionFactory
> mqConnectionFactory = new MQConnectionFactory();
>
>  mqConnectionFactory.setHostName("localhost");
>
>  mqConnectionFactory.setPort(1440);
>
>  mqConnectionFactory.setQueueManager("MY.QMGR");
>
>  mqConnectionFactory.setChannel("MY.SVRCONN.CHANNEL");
>
> *
> mqConnectionFactory.setStringProperty("foo",
> "bar");*
>
>
>  return mqConnectionFactory;
>   }
>
> }
>
>
>
>
>
> --
> Rachit Gandhi
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: [Camel + Websphere MQ ] How to send MQRFH2 properties and ReplyToQ

2013-11-07 Thread David Karlsen
camel-jms is based on spring-jms, so the same concept applies.
Search for "destinationResolver" on this page:
http://camel.apache.org/jms.html
http://docs.spring.io/spring/docs/3.2.5.RELEASE/spring-framework-reference/html/jms.html
 (23.2.3)


2013/11/7 nanotech 

> Hi David,
> Thanks for the reply.
> I am not using Spring user. Can you give me a pointer as to how to use in a
> non-spring setting (i.e. using Java DSL )
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Fwd-Camel-Websphere-MQ-How-to-send-MQRFH2-properties-and-ReplyToQ-tp5742791p5742796.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: camel-soap schema validation

2013-11-08 Thread David Karlsen
You could stick a validator as the second step in the route? There is a
camel-validator component
8. nov. 2013 13:53 skrev "helander"  følgende:

> Is it possible to do schema validation while unmarshalling SOAP XML
> messages
> using the camel-soap dataformat?
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-soap-schema-validation-tp5742850.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Email Alerts Upon FTP Failure

2013-12-06 Thread David Karlsen
Have a look at:
http://camel.apache.org/exception-clause.html or
http://camel.apache.org/error-handler.html
and use http://camel.apache.org/mail.html to send the mail.

Good luck!


2013/12/5 funkymonk 

> Hello -
>
> I am brand new to Camel and I've got a handful of very basic blueprint
> routes up and running.   Some of my FTP routes are critical and I'd like to
> receive an email alert if the FTP transmission fails.  Is there a way to do
> this using the basic blueprint?  Any information would be greatly
> appreciated.  Thanks!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Email-Alerts-Upon-FTP-Failure-tp5744376.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Transaction spanning multiple routes separated by seda queue

2014-01-16 Thread David Karlsen
AFAIK this is not supported, because transactions are threadbound and the
SEDA stuff will run of another thread than the one that started the
transaction, and hence not able to participate in it.


2014/1/16 gilboy 

> Hi
>
> I have a route to consume a message from a JMS Topic, do some processing on
> it and then place on a SEDA Queue.
>
> My second route will consume the message from the SEDA queue and place on a
> different JMS Topic.
>
> I want to ensure that the message only gets de-queued from the first Topic
> which it has successfully been placed on the 2nd topic. Is this possible?
>
> Thanks in advance
> Joe
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Transaction-spanning-multiple-routes-separated-by-seda-queue-tp5746041.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Camel - TestNG and Spring 4

2014-02-24 Thread David Karlsen
Yeah - you can track this:
https://issues.apache.org/jira/browse/CAMEL-7074(which was created ti
address exactly the issue you mention).


2014-02-24 16:58 GMT+01:00 Christian Müller :

> There is an open ticket to support Spring 4. It's not supported at present.
>
> Best,
>
> Christian
> -
>
> Software Integration Specialist
>
> Apache Member
> V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
> Apache Incubator PMC Member
>
> https://www.linkedin.com/pub/christian-mueller/11/551/642
>
>
> On Mon, Feb 24, 2014 at 12:35 PM, blacar  wrote:
>
> > Hello,
> >
> > We've found a problem using Camel - TestNG and Spring4.
> >
> > The error states that interface
> > org.springframework.test.context.TestContext
> > was found, but class was expected.
> >
> > This seems to be that TestContext was a class on Spring < 4 but now it is
> > an
> > interface and Camel-Testng module maybe has not been updated yet.
> >
> > May i be correct?
> >
> > Is there any workarround?
> >
> > Thanks in advance,
> >
> > RBC
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Camel-TestNG-and-Spring-4-tp5747854.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: How to write messages in EBCDIC format into a queue (websphere mq) by came JMS Component

2014-02-26 Thread David Karlsen
You post it in whatever character set suits you, and as a TextMessage, and
the receiving side can define what character set they want to read it with,
offleaving the conversion to WMQ. See:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzak.doc%2Ffr17310_.htm


2014-02-26 14:58 GMT+01:00 Shyam S Swaroop :

> I am writing a string message into queue (websphere mq).This is done by a
> camel JMS component. My understanding is by default this message is in
> ASCII
> format. Is there any way to configure this jms component so that message
> will be in *EBCDIC *format.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-write-messages-in-EBCDIC-format-into-a-queue-websphere-mq-by-came-JMS-Component-tp5748015.html
> Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: How to write messages in EBCDIC format into a queue (websphere mq) by came JMS Component

2014-02-26 Thread David Karlsen
Here is a resource as well:
http://www-01.ibm.com/support/docview.wss?uid=swg27005729&aid=1


2014-02-26 16:19 GMT+01:00 David Karlsen :

> You post it in whatever character set suits you, and as a TextMessage, and
> the receiving side can define what character set they want to read it with,
> offleaving the conversion to WMQ. See:
> http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzak.doc%2Ffr17310_.htm
>
>
> 2014-02-26 14:58 GMT+01:00 Shyam S Swaroop :
>
> I am writing a string message into queue (websphere mq).This is done by a
>> camel JMS component. My understanding is by default this message is in
>> ASCII
>> format. Is there any way to configure this jms component so that message
>> will be in *EBCDIC *format.
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/How-to-write-messages-in-EBCDIC-format-into-a-queue-websphere-mq-by-came-JMS-Component-tp5748015.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: JMS peek?

2014-04-12 Thread David Karlsen
Yes, use the JMS browse functionality:
http://camel.apache.org/browse.html
http://docs.oracle.com/cd/E19798-01/821-1841/bncey/index.html


2014-04-12 20:53 GMT+02:00 Larry Meadors :

> Is there a clever way to do a "peek" operation with AMQ in camel?
>
> I want to trigger an action if there are any messages in a queue, but
> not consume any of them.
>
> Larry
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Configuring JMS connection pool for WMQ

2014-04-16 Thread David Karlsen
Yes to all questions.
Just use the internal pooling:
com.ibm.mq.jms.MQConnectionFactory has a property
setUseConnectionPooling(boolean yesno)


2014-04-15 19:12 GMT+02:00 smadarapu :

> Hi
>
> I have been successfully running several routes connecting to a JMS queue
> using Websphere MQ. I have several routes each of them handling specific
> messages (using selectors). No I am at a point where the number of
> connections to the queue are growing and want to use a connection pool.
>
> I am trying the CachingConnectionFactory but running into class cast
> exceptions...
>
>  class="org.springframework.jms.connection.CachingConnectionFactory">
>  ref="inboundMqConnectionFactory1"
> />
> 
> 
>
>  class="org.apache.camel.component.jms.JmsComponent">
>  ref="inCachingConnectionFactory" />
>  />
> 
> 
> 
>
>  class="com.ibm.mq.jms.MQQueueConnectionFactory">
> 
> 
>  value="${isi.inbound.queue.queuemanager2}" />
> 
>  />
> 
>
> Could not find a WMQ specific connection pool and according to this post
>
> http://stackoverflow.com/questions/8922339/how-to-pooling-the-jms-connection-in-a-standalone-java-applications
> the pool support has been removed by WMQ, not sure why.
>
> Have any body have success using a connection pool with camel, spring, wmq
> ?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Configuring-JMS-connection-pool-for-WMQ-tp5750258.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Compound expression for idempotent consumer

2014-05-22 Thread David Karlsen
Hi.

I'm wanting to setup a idempotent consumer, but combine several expressions
as the key.
(an xpath-expression on the payload + a property set on the exchange.

Is this possible?



//somens:MsgId/text() <--only xpath - works, but:

 <--how can I use this to combine several
expressions?
//somens:MsgId/text()
<... use property on exchange to combine them >
 
.

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Idempotent inconsistencies

2014-05-22 Thread David Karlsen
IdempotentConsumer demands that the messageId is a string:

final String messageId = messageIdExpression.evaluate(exchange,
String.class);
if (messageId == null) {
throw new NoMessageIdException(exchange, messageIdExpression);
}

boolean newKey;
if (eager) {
// add the key to the repository
newKey = idempotentRepository.add(messageId);
} else {
// check if we already have the key
newKey = !idempotentRepository.contains(messageId);
}

(Why isn't it an object or a parameterized type?)

but the IdempotentRepository interface is parameterized to hold any type 


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Idempotent inconsistencies

2014-05-23 Thread David Karlsen
Done: https://issues.apache.org/jira/browse/CAMEL-7461



2014-05-23 8:48 GMT+02:00 Claus Ibsen :

> Hi
>
> I think its historical reasons with using strings first in Camel.
>
> You are welcome to log a ticket to get this improved in a future release
>
> On Thu, May 22, 2014 at 9:12 PM, David Karlsen 
> wrote:
> > IdempotentConsumer demands that the messageId is a string:
> >
> > final String messageId = messageIdExpression.evaluate(exchange,
> > String.class);
> > if (messageId == null) {
> > throw new NoMessageIdException(exchange,
> messageIdExpression);
> > }
> >
> > boolean newKey;
> > if (eager) {
> > // add the key to the repository
> > newKey = idempotentRepository.add(messageId);
> > } else {
> > // check if we already have the key
> > newKey = !idempotentRepository.contains(messageId);
> > }
> >
> > (Why isn't it an object or a parameterized type?)
> >
> > but the IdempotentRepository interface is parameterized to hold any type
> 
> >
> >
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Add custom stringproperty to jms message

2014-05-30 Thread David Karlsen
Hi.

I'm using camel for my communcations, and specifically WebSphere WMQ as the
JMS middleware.
I want to set a custom string property on the messages sent:
http://docs.oracle.com/javaee/1.4/api/javax/jms/Message.html#setStringProperty(java.lang.String,
java.lang.String)

My route looks like this:




${in.body.getPayload()}


true





I cannot see that the property is set - am I doing something wrong?

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Add custom stringproperty to jms message

2014-05-30 Thread David Karlsen
Sorry, I don't get you.
I've read the specs (and looked into camels code)
As far as I can see I'm playing by the rules:

The exchange that is sent over the JMS wire must conform to the JMS Message
spec .

For the exchange.in.header the following rules apply for the header *keys*:

   - Keys starting with JMS or JMSX are reserved.
   - exchange.in.headers keys must be literals and all be valid Java
   identifiers (do not use dots in the key name).
   - Camel replaces dots & hyphens and the reverse when when consuming JMS
   messages:
   . is replaced by _DOT_ and the reverse replacement when Camel consumes
   the message.
   - is replaced by _HYPHEN_ and the reverse replacement when Camel
   consumes the message.
   - See also the option jmsKeyFormatStrategy, which allows use of your own
   custom strategy for formatting keys.

For the exchange.in.header, the following rules apply for the header
*values*:

   - The values must be primitives or their counter objects (such as Integer
   , Long, Character). The types, String, CharSequence, Date, BigDecimal
and BigInteger are all converted to their toString() representation.
   All other types are dropped.


ans also the only ones that get filtered on inbound messages are the
default JMSX ones:
protected void initialize() {
// ignore provider specified JMS extension headers see page 39 of
JMS 1.1 specification
// added "JMSXRecvTimestamp" as a workaround for an Oracle bug/typo
in AqjmsMessage
getOutFilter().add("JMSXUserID");
getOutFilter().add("JMSXAppID");
getOutFilter().add("JMSXDeliveryCount");
getOutFilter().add("JMSXProducerTXID");
getOutFilter().add("JMSXConsumerTXID");
getOutFilter().add("JMSXRcvTimestamp");
getOutFilter().add("JMSXRecvTimestamp");
getOutFilter().add("JMSXState");
}


2014-05-30 13:58 GMT+02:00 pradeep :

> Hi,
>
> In the above code snippet the camel header is set. So when the JMS
> consumer(WMq consumer) receives the actual message then this camel header
> will be lost. Instead of camel header you can set camel jms header. Have a
> look at the camel jms headers details documented in this link:
> http://camel.apache.org/jms.html
>
> Regards,
> PradeepN
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Add-custom-stringproperty-to-jms-message-tp5751745p5751747.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Add custom stringproperty to jms message

2014-06-01 Thread David Karlsen
Hi.

Thank you for the response.
I dug a little deeper and found out the middleware was removing the headers
although they were delivered just nicely to it.
If I changed a mode as described in
http://www-01.ibm.com/support/docview.wss?uid=swg21573858 it worked ok.
So not a camel problem - but a WMQ one (surprise, surprise!)

Sorry for the noise


2014-05-31 8:45 GMT+02:00 Claus Ibsen :

> Hi
>
> I wonder if true renders a boolean or string.
> And whether a boolean type is jms compliant.
>
> You can enable TRACE or DEBUG logging on
> org.apache.camel.component.jms, and see if Camel says anything about
> dropping a header as its not spec compliant.
>
> Also Camel logs the JMS being sent with its content, so you ought to
> see if your header is there.
>
>
>
> On Fri, May 30, 2014 at 2:25 PM, David Karlsen 
> wrote:
> > Sorry, I don't get you.
> > I've read the specs (and looked into camels code)
> > As far as I can see I'm playing by the rules:
> >
> > The exchange that is sent over the JMS wire must conform to the JMS
> Message
> > spec <http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html>.
> >
> > For the exchange.in.header the following rules apply for the header
> *keys*:
> >
> >- Keys starting with JMS or JMSX are reserved.
> >- exchange.in.headers keys must be literals and all be valid Java
> >identifiers (do not use dots in the key name).
> >- Camel replaces dots & hyphens and the reverse when when consuming
> JMS
> >messages:
> >. is replaced by _DOT_ and the reverse replacement when Camel consumes
> >the message.
> >- is replaced by _HYPHEN_ and the reverse replacement when Camel
> >consumes the message.
> >- See also the option jmsKeyFormatStrategy, which allows use of your
> own
> >custom strategy for formatting keys.
> >
> > For the exchange.in.header, the following rules apply for the header
> > *values*:
> >
> >- The values must be primitives or their counter objects (such as
> Integer
> >, Long, Character). The types, String, CharSequence, Date, BigDecimal
> > and BigInteger are all converted to their toString() representation.
> >All other types are dropped.
> >
> >
> > ans also the only ones that get filtered on inbound messages are the
> > default JMSX ones:
> > protected void initialize() {
> > // ignore provider specified JMS extension headers see page 39 of
> > JMS 1.1 specification
> > // added "JMSXRecvTimestamp" as a workaround for an Oracle
> bug/typo
> > in AqjmsMessage
> > getOutFilter().add("JMSXUserID");
> > getOutFilter().add("JMSXAppID");
> > getOutFilter().add("JMSXDeliveryCount");
> > getOutFilter().add("JMSXProducerTXID");
> > getOutFilter().add("JMSXConsumerTXID");
> > getOutFilter().add("JMSXRcvTimestamp");
> > getOutFilter().add("JMSXRecvTimestamp");
> > getOutFilter().add("JMSXState");
> > }
> >
> >
> > 2014-05-30 13:58 GMT+02:00 pradeep :
> >
> >> Hi,
> >>
> >> In the above code snippet the camel header is set. So when the JMS
> >> consumer(WMq consumer) receives the actual message then this camel
> header
> >> will be lost. Instead of camel header you can set camel jms header.
> Have a
> >> look at the camel jms headers details documented in this link:
> >> http://camel.apache.org/jms.html
> >>
> >> Regards,
> >> PradeepN
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Add-custom-stringproperty-to-jms-message-tp5751745p5751747.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
> >
> >
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: camel-ftp: fileExist=Append not working

2014-06-02 Thread David Karlsen
Probably permissions on the ftp server don't allow you to write to the file
once it's first uploaded. I guess you wouldn't be allowed to delete it over
ftp either.
2. Juni 2014 14:11 skrev "simonglaubitz"  følgende:

> Short addition to my original post:
>
> when changing the destination of my route from FTP to FILE component
> fileExist=Append works perfectly fine.
>
> FTP:
> ftp://testuser@testserver
> /test?password=testpassword&fileName=test.txt&fileExist=Append
>
> FILE:
> file:C:/test?fileName=test.txt&fileExist=Append
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-ftp-fileExist-Append-not-working-tp5751819p5751820.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Best Efforts 1 PC pattern - from MQ to DB

2014-06-06 Thread David Karlsen
We use only the IBM one and it works fine
6. Juni 2014 16:15 skrev "dancsi"  følgende:

> Anyone having experience with IBM/WebSphere MQ? Shall I rely on WMQ
> Connection Factory caching or shall I rather configure Spring's
> CachingConnectionFactory?
>
> Thanks a lot,
> Dan
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Best-Efforts-1-PC-pattern-from-MQ-to-DB-tp5751757p5751997.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: What's the point of the OUT message on an Exchange?

2014-06-28 Thread David Karlsen
Also note that there is a DSL mechanism to mangle propagation of headers:
http://camel.apache.org/how-to-avoid-sending-some-or-all-message-headers.html


2014-06-27 19:47 GMT+02:00 Matt Sicker :

> Thank you, that actually helped quite a bit! I see that using the in
> message is just more convenient than copying headers all the time for an
> InOut chain.
>
>
> On 27 June 2014 00:44, Claus Ibsen  wrote:
>
> > Hi
> >
> > See this FAQ
> > http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
> >
> > If you have a copy of the Camel in Action book, see page 66 for more
> > details as well.
> >
> > On Thu, Jun 26, 2014 at 10:44 PM, Matt Sicker  wrote:
> > > I don't understand what the point of using the out message is. It
> doesn't
> > > copy headers. It doesn't signify the end of a route as far as I can
> tell.
> > > It's not used for a reply message. I don't think any of the official
> > Camel
> > > components even use the out message. What good is it for?
> > >
> > > In my own project, I've created a final processor that copies the in
> > > message to the out message and selectively fills in headers that were
> > > configured for that processor. I don't even know why I do this other
> than
> > > as a way to get rid of the myriad JMS headers that get passed around
> from
> > > using JMS (and occasionally rogue HTTP headers returned from a SOAP
> call
> > > somewhere).
> > >
> > > Are there any good resources or explanations as to the point of the out
> > > message? It seems to complicate things as it doesn't seem as though you
> > can
> > > send a dual-message of anything by using both the in and out messages.
> > >
> > > --
> > > Matt Sicker 
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > Red Hat, Inc.
> > Email: cib...@redhat.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> > hawtio: http://hawt.io/
> > fabric8: http://fabric8.io/
> >
>
>
>
> --
> Matt Sicker 
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Anyone seen this problem: Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2195

2014-07-21 Thread David Karlsen
Have you added all the mq jars? There is quite a number of them. And are
they all from the same mq version?
You have a list of errorcodes here:
http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.0.1/com.ibm.mq.csqsao.doc/fm13700_1.htm?cp=SSFKSJ_7.0.1%2F1-28-46-1-0-165&lang=en



2014-07-22 7:57 GMT+02:00 Frankiboy :

> Thanks for the reply.
>
> All the examples i have looked at is this the way to do it, yes its
> possible
> to use sjms, this is new, and there stille some problems using it.
>
> I have struggelt with this problem for 2 days now, i dont know what my
> problem is here
>
> Frank
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Anyone-seen-this-problem-Caused-by-com-ibm-mq-jmqi-JmqiException-CC-2-RC-2195-tp5754142p5754185.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re:

2014-07-29 Thread David Karlsen
Maybe create an instance and stick it into a camel header (the header will
follow the exchange, and thus the lifecycle of passing through the route).?


2014-07-29 22:10 GMT+02:00 rickaroni :

> Hi Michael,
>
> I hear you.  The trouble is, sometimes the intermediate transports (e.g.
> the
> Camel Salesforce component) hijack the header and body for their own needs
> and you don't have full control over them.
>
> In similar ESBs, I've seen some shops make their own custom Spring message
> scope to be the lifetime of (the equivalent of) a route.
>
> That works pretty nicely when it's needed.  I was hoping to avoid having to
> write this myself, but can if needed.
>
> Thanks a lot,
> Rick
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/to-bean-xxx-or-not-to-bean-xxx-Getting-clarity-on-bean-scope-tp5754593p5754609.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Problems prettyPrinting JSON after camel 2.14.0 upgrade

2014-09-19 Thread David Karlsen
With the config:




I get:

.. because of Failed to set property: prettyPrint on:
org.apache.camel.component.jackson.JacksonDataFormat@77ab22be. Reason:
java.lang.IllegalArgumentException: Could not find a suitable setter for
property: prettyPrint as there isn't a setter method with same type: [null]
nor type conversion possible: null

at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)

at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)

at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)

at
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)

at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)

at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)

at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)

at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)

at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)

at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
after this upgrade:

-2.13.2

+2.14.0


jira https://issues.apache.org/jira/browse/CAMEL-7639 says it was fixed for
2.14.0 - but it actually worked before on 2.13.2?
-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Problems prettyPrinting JSON after camel 2.14.0 upgrade

2014-09-21 Thread David Karlsen
t.java:331)

at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)

at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)

at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)

at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)

at
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)

at
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:260)

at
org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:63)

at
org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:83)

... 33 more

2014-09-20 19:05 GMT+02:00 Claus Ibsen :

> Hi
>
> Don't you have more in the stacktrace or some other error? There is
> maybe some NPE that hides this error.
>
> On Fri, Sep 19, 2014 at 1:53 PM, David Karlsen 
> wrote:
> > With the config:
> > 
> > 
> > 
> >
> > I get:
> >
> > .. because of Failed to set property: prettyPrint on:
> > org.apache.camel.component.jackson.JacksonDataFormat@77ab22be. Reason:
> > java.lang.IllegalArgumentException: Could not find a suitable setter for
> > property: prettyPrint as there isn't a setter method with same type:
> [null]
> > nor type conversion possible: null
> >
> > at
> >
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
> >
> > at
> >
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)
> >
> > at
> >
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
> >
> > at
> >
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
> >
> > at
> >
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
> >
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
> >
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
> >
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
> >
> > at
> >
> org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
> >
> > at
> >
> org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
> > after this upgrade:
> >
> > -2.13.2
> >
> > +2.14.0
> >
> >
> > jira https://issues.apache.org/jira/browse/CAMEL-7639 says it was fixed
> for
> > 2.14.0 - but it actually worked before on 2.13.2?
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: [bug]restConfiguration - jetty - endpointProperty

2014-09-27 Thread David Karlsen
I created an issue + PR: https://issues.apache.org/jira/browse/CAMEL-7868

2014-09-27 10:04 GMT+02:00 Claus Ibsen :

> Hi
>
> Ah well spotted. You are welcome to log a JIRA ticket and work on a
> patch. If you know github then we accept PRs from that.
> http://camel.apache.org/contributing.html
>
>
>
> On Sat, Sep 27, 2014 at 10:01 AM, kuro <962...@gmail.com> wrote:
> > I found a bug.
> >
> > [source code]
> >
> https://github.com/apache/camel/blob/camel-2.14.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java#L996
> >
> > 
> > [bug]
> >
> > String url = "jetty:%s://%s:%s/%s?httpMethodRestrict=%s";
> > if (!query.isEmpty()) {
> > url = url + "?" + query;
> > }
> >
> > 
> > [correction]
> >
> >  String url = "jetty:%s://%s:%s/%s?httpMethodRestrict=%s";
> > if (!query.isEmpty()) {
> > url = url + "&" + query;
> > }
> >
> > 
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/bug-restConfiguration-jetty-endpointProperty-tp5757065.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Problems prettyPrinting JSON after camel 2.14.0 upgrade

2014-09-27 Thread David Karlsen
Any update on this?

2014-09-21 22:28 GMT+02:00 David Karlsen :

> java.lang.IllegalStateException: Failed to load ApplicationContext
>
> at
> org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:91)
>
> at
> org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:74)
>
> at
> org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:116)
>
> at
> org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:82)
>
> at
> org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:199)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:251)
>
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:253)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82)
>
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>
> at
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>
> at
> org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60)
>
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>
> at
> org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67)
>
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>
> at
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162)
>
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
>
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
>
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:483)
>
> at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
>
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
>
> at
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
>
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
>
> at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
>
> Caused by: org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> fetchFullAnalysisRoute at: >>>
> Unmarshal[org.apache.camel.model.dataformat.JsonDataFormat@441fbe89] <<<
> in route: Route(fetchFullAnalysisRoute)[[From[direct:fetchFullAnalysis...
> because of Failed to set property: prettyPrint on:
> org.apache.camel.component.jackson.JacksonDataFormat@4ed15347. Reason:
> java.lang.IllegalArgumentException: Could not find a suitable setter for
> property: prettyPrint as there isn't a setter method with same type: [null]
> nor type conversion possible: null
>
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
>
> at
> org.a

Re: Problems prettyPrinting JSON after camel 2.14.0 upgrade

2014-09-27 Thread David Karlsen
Created https://issues.apache.org/jira/browse/CAMEL-7874


2014-09-27 17:13 GMT+02:00 Babak Vahdat :

> Hi,
>
> I looked a bit into the codebase regarding this and spotted some space for
> improvement:
>
> - First of all there's a copy/paste typo at the following line (pasted from
> the previous code block):
>
>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java#L175
>
> As it tries to set the the unmarshalType object value for the prettyPrint
> property, which is wrong.
>
> - Secondly with the current codebase it's *only* the JacksonDataFormat
> which
> *truly* supports the prettyPrint option:
>
>
> https://github.com/apache/camel/blob/master/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java#L46
>
> And *all* the other formats fail to do so (including the default XStream
> format), as they don't own any prettyPrint property! The last Gson format
> below has a wrong naming: 'prettyPrinting' instead of 'prettyPrint'.
>
>
> https://github.com/apache/camel/blob/master/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java
>
>
> https://github.com/apache/camel/blob/master/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
>
>
> https://github.com/apache/camel/blob/master/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
>
> Last but not least, we should better not ignore the case if no setter
> method
> is found below (IntrospectionSupport#setProperty would return false in such
> a case)
>
>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java#L148
>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java#L150
>
> As otherwise we don't know if a given data format *truly* supports a given
> option called x. Currently we would ignore the case if there’s no setX()
> setter method on a given dataformat object.
>
> I guess the current workaround for you is to make use of Jackson:
>
>   
>
> Would you mind to raise a ticket?
>
> Babak
>
> David J. M. Karlsen wrote
> > With the config:
> > 
> >
> > 
> >
> > 
> > I get:
> >
> > .. because of Failed to set property: prettyPrint on:
> > org.apache.camel.component.jackson.JacksonDataFormat@77ab22be. Reason:
> > java.lang.IllegalArgumentException: Could not find a suitable setter for
> > property: prettyPrint as there isn't a setter method with same type:
> > [null]
> > nor type conversion possible: null
> >
> > at
> >
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
> >
> > at
> >
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)
> >
> > at
> >
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
> >
> > at
> >
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
> >
> > at
> >
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
> >
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
> >
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
> >
> > at
> >
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
> >
> > at
> >
> org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
> >
> > at
> >
> org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
> > after this upgrade:
> >
> > -
> > 
> > 2.13.2
> > 
> > +
> > 
> > 2.14.0
> > 
> >
> > jira https://issues.apache.org/jira/browse/CAMEL-7639 says it was fixed
> > for
> > 2.14.0 - but it actually worked before on 2.13.2?
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Problems-prettyPrinting-JSON-after-camel-2-14-0-upgrade-tp5756738p5757104.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Problems prettyPrinting JSON after camel 2.14.0 upgrade

2014-09-28 Thread David Karlsen
Did not work with latest published snapshots - but perhaps a successful
build&deploy has not yet completed?

2014-09-27 22:40 GMT+02:00 Babak Vahdat :

> Thanks for raising the ticket which is fixed now, both on the master as
> well
> as the 2.14.x branch. Would you mind to give it a shot to see if it works
> for you now?
>
> I also raised another ticket regarding my previous comment about the
> possible improvement
> https://issues.apache.org/jira/browse/CAMEL-7877
>
> Babak
>
> David J. M. Karlsen wrote
> > Created https://issues.apache.org/jira/browse/CAMEL-7874
> >
> >
> > 2014-09-27 17:13 GMT+02:00 Babak Vahdat <
>
> > babak.vahdat@
>
> > >:
> >
> >> Hi,
> >>
> >> I looked a bit into the codebase regarding this and spotted some space
> >> for
> >> improvement:
> >>
> >> - First of all there's a copy/paste typo at the following line (pasted
> >> from
> >> the previous code block):
> >>
> >>
> >>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java#L175
> >>
> >> As it tries to set the the unmarshalType object value for the
> prettyPrint
> >> property, which is wrong.
> >>
> >> - Secondly with the current codebase it's *only* the JacksonDataFormat
> >> which
> >> *truly* supports the prettyPrint option:
> >>
> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java#L46
> >>
> >> And *all* the other formats fail to do so (including the default XStream
> >> format), as they don't own any prettyPrint property! The last Gson
> format
> >> below has a wrong naming: 'prettyPrinting' instead of 'prettyPrint'.
> >>
> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java
> >>
> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
> >>
> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
> >>
> >> Last but not least, we should better not ignore the case if no setter
> >> method
> >> is found below (IntrospectionSupport#setProperty would return false in
> >> such
> >> a case)
> >>
> >>
> >>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java#L148
> >>
> >>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java#L150
> >>
> >> As otherwise we don't know if a given data format *truly* supports a
> >> given
> >> option called x. Currently we would ignore the case if there’s no setX()
> >> setter method on a given dataformat object.
> >>
> >> I guess the current workaround for you is to make use of Jackson:
> >>
> >>
> > 
> >>
> >> Would you mind to raise a ticket?
> >>
> >> Babak
> >>
> >> David J. M. Karlsen wrote
> >> > With the config:
> >> >
> > 
> >> >
> >> >
> > 
> >> >
> >> >
> > 
> >> > I get:
> >> >
> >> > .. because of Failed to set property: prettyPrint on:
> >> > org.apache.camel.component.jackson.JacksonDataFormat@77ab22be.
> Reason:
> >> > java.lang.IllegalArgumentException: Could not find a suitable setter
> >> for
> >> > property: prettyPrint as there isn't a setter method with same type:
> >> > [null]
> >> > nor type conversion possible: null
> >> >
> >> > at
> >> >
> >>
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
> >> >
> >> > at
> >> >
> >>
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)
> >> >
> >> > at
> >> >
> >>
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:327)
> >> >
> >> > at
> >> >
> >>
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
> >> >
> >> > at
> >> >
> >>
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
> >> >
> >> > at
> >> >
> >>
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
> >> >
> >> > at
> >> >
> >>
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
> >> >
> >> > at
> >> >
> >>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
> >> >
> >> > at
> >> >
> >>
> org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
> >> >
> >> > at
> >> >
> >>
> org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
> >> > after this

Re: Problems prettyPrinting JSON after camel 2.14.0 upgrade

2014-09-28 Thread David Karlsen
Tried building it earlier on before I sent the mail - but it failed on some
missing jboss component (built the whole tree).
Anyways - working fine with 2.14.1-SNAPSHOT!
Thanks!

2014-09-28 21:10 GMT+02:00 Babak Vahdat :

> Ah but much easier is to build the master branch on your box locally using
> the latest codebase (however without running the tests which would not take
> more than couple of minutes) so that your m2-cache for the 2.15-SNAPSHOT
> version is up-to-date. Then you could run/test your app using your locally
> installed Camel bundles version 2.15-SNAPSHOT.
>
> That all said I forced a build on the CI-Server:
> https://builds.apache.org/job/Camel.trunk.notest/2177
>
> Which updated the artifacts of the Apache snapshot repo right before, e.g.
> the camel-core bundle below:
>
> http://repository.apache.org/content/repositories/snapshots/org/apache/camel/camel-core/2.15-SNAPSHOT/camel-core-2.15-20140928.184831-29.jar
>
> So maybe make sure to include the Apache snapshot repo inside your (parent)
> POM:
> http://camel.apache.org/maven-2-snapshot-repository-in-pom.html
>
> And now using the Maven "-U" option run/test your app again.
>
> Babak
>
> David J. M. Karlsen wrote
> > Did not work with latest published snapshots - but perhaps a successful
> > build&deploy has not yet completed?
> >
> > 2014-09-27 22:40 GMT+02:00 Babak Vahdat <
>
> > babak.vahdat@
>
> > >:
> >
> >> Thanks for raising the ticket which is fixed now, both on the master as
> >> well
> >> as the 2.14.x branch. Would you mind to give it a shot to see if it
> works
> >> for you now?
> >>
> >> I also raised another ticket regarding my previous comment about the
> >> possible improvement
> >> https://issues.apache.org/jira/browse/CAMEL-7877
> >>
> >> Babak
> >>
> >> David J. M. Karlsen wrote
> >> > Created https://issues.apache.org/jira/browse/CAMEL-7874
> >> >
> >> >
> >> > 2014-09-27 17:13 GMT+02:00 Babak Vahdat <
> >>
> >> > babak.vahdat@
> >>
> >> > >:
> >> >
> >> >> Hi,
> >> >>
> >> >> I looked a bit into the codebase regarding this and spotted some
> space
> >> >> for
> >> >> improvement:
> >> >>
> >> >> - First of all there's a copy/paste typo at the following line
> (pasted
> >> >> from
> >> >> the previous code block):
> >> >>
> >> >>
> >> >>
> >>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/dataformat/JsonDataFormat.java#L175
> >> >>
> >> >> As it tries to set the the unmarshalType object value for the
> >> prettyPrint
> >> >> property, which is wrong.
> >> >>
> >> >> - Secondly with the current codebase it's *only* the
> JacksonDataFormat
> >> >> which
> >> >> *truly* supports the prettyPrint option:
> >> >>
> >> >>
> >> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/JacksonDataFormat.java#L46
> >> >>
> >> >> And *all* the other formats fail to do so (including the default
> >> XStream
> >> >> format), as they don't own any prettyPrint property! The last Gson
> >> format
> >> >> below has a wrong naming: 'prettyPrinting' instead of 'prettyPrint'.
> >> >>
> >> >>
> >> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java
> >> >>
> >> >>
> >> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
> >> >>
> >> >>
> >> >>
> >>
> https://github.com/apache/camel/blob/master/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
> >> >>
> >> >> Last but not least, we should better not ignore the case if no setter
> >> >> method
> >> >> is found below (IntrospectionSupport#setProperty would return false
> in
> >> >> such
> >> >> a case)
> >> >>
> >> >>
> >> >>
> >>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java#L148
> >> >>
> >> >>
> >>
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/DataFormatDefinition.java#L150
> >> >>
> >> >> As otherwise we don't know if a given data format *truly* supports a
> >> >> given
> >> >> option called x. Currently we would ignore the case if there’s no
> >> setX()
> >> >> setter method on a given dataformat object.
> >> >>
> >> >> I guess the current workaround for you is to make use of Jackson:
> >> >>
> >> >>
> >> >
> > 
> >> >>
> >> >> Would you mind to raise a ticket?
> >> >>
> >> >> Babak
> >> >>
> >> >> David J. M. Karlsen wrote
> >> >> > With the config:
> >> >> >
> >> >
> > 
> >> >> >
> >> >> >
> >> >
> > 
> >> >> >
> >> >> >
> >> >
> > 
> >> >> > I get:
> >> >> >
> >> >> > .. because of Failed to set property: prettyPrint on:
> >> >> > org.apache.camel.component.jackson.JacksonDataFormat@77ab22be.
> >> Reason:
> >> >> > java.lang.IllegalArgumentException: Could not find a suitable
> setter
> >> >> for
> >> >> > property: pret

Re: Tail like File component?

2014-11-17 Thread David Karlsen
You can try the stream component:
http://camel.apache.org/stream.html

2014-11-17 21:32 GMT+01:00 Gonzalo Vasquez :

> Hi everybody.
>
> Is it possible to use the File component (or other component) as a
> consumer to mimic unix 'tai'l command? What I mean is: monitor a folder /
> file and do something on each new line added to such fileI guess the
> streaming option would help, but not sure on how to keep the File always
> open and not to end on the last available line, also I'm wondering on how
> to signal a file end or something like that.
>
> Regards,
> Gonzalo Vásquez Sáez
> Gerente Investigación y Desarrollo (R&D)
> Altiuz Soluciones Tecnológicas de Negocios Ltda.
> Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
> +56 2 335 2461
> gvasq...@altiuz.cl
> http://www.altiuz.cl
> http://www.altiuzreports.com
>
>
>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: how to execte jdbc IN clause statement

2014-11-22 Thread David Karlsen
Would a collection of integers work?
22. Nov. 2014 13:06 skrev "chaituu" :

> 22 04:02:32,011  #0 - timer://timer1 TimerConsumer WARN
> warnMarkerIgnoringBase.java
> :136Error processing exchange. Exchange[Message: UPDATE TEST SET
> FLAG='Y' WHERE ID IN(:?ids)]. Caused by: [java.sql.SQLSyntaxErrorException
> -
> ORA-01722: invalid number
> ]
> java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
>
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
> at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
> at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
>
> 
> 
>   
> 127,128
>   
>
>
> 
>   UPDATE TEST SET FLAG='Y' WHERE ID IN(:?ids)
> 
>   
>   
>
> 
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-to-execte-jdbc-IN-clause-statement-tp5759495.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: how to execte jdbc IN clause statement

2014-11-22 Thread David Karlsen
Would a collection of integers work?
22. Nov. 2014 13:06 skrev "chaituu" :

> 22 04:02:32,011  #0 - timer://timer1 TimerConsumer WARN
> warnMarkerIgnoringBase.java
> :136Error processing exchange. Exchange[Message: UPDATE TEST SET
> FLAG='Y' WHERE ID IN(:?ids)]. Caused by: [java.sql.SQLSyntaxErrorException
> -
> ORA-01722: invalid number
> ]
> java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
>
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
> at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
> at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
>
> 
> 
>   
> 127,128
>   
>
>
> 
>   UPDATE TEST SET FLAG='Y' WHERE ID IN(:?ids)
> 
>   
>   
>
> 
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-to-execte-jdbc-IN-clause-statement-tp5759495.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: how to execte jdbc IN clause statement

2014-11-23 Thread David Karlsen
You can still run a prepared statement - but the db-server will have to
parse and compile the different versions (one per length variant of the
list).
http://www.javaranch.com/journal/200510/Journal200510.jsp#a2

2014-11-23 17:25 GMT+01:00 Claus Ibsen :

> Hi
>
> The IN is not supported. I am not sure how this would work out, as
> then you can likely not use prepared statements, but have to fallback
> to a standard SQL, and then build the query dynamic.
>
> Then the IN should be expanded, as N1, N2, N3 etc.
>
> So there is some work to do this, and also safely detect the IN, or
> that the end user need to set some option to the SQL endpoint so it
> knows its a IN and need special handling.
>
> Or am I wrong about prepared statement not supporting IN with has
> dynamic values easily?
>
> On Sun, Nov 23, 2014 at 11:03 AM, chaituu  wrote:
> > i have written custom prepared strategy,how to set parameter for ids' in
> > update query
> >
> >
> >
> > public class CustomPrepareStatementStrategy extends
> > org.apache.camel.component.jdbc.DefaultJdbcPrepareStatementStrategy {
> >
> >
> >
> >  private static final transient Logger LOG =
> > Logger.getLogger(CustomPrepareStatementStrategy.class);
> >
> > @Override
> > public Iterator createPopulateIterator(String query,
> > String preparedQuery, int expectedParams,
> Exchange exchange,
> > Object value) throws SQLException {
> >
> > LOG.info(preparedQuery+"   preparedQuery:query:"+query);
> > String body =exchange.getIn().getBody(String.class);
> > String header= (String)exchange.getIn().getHeader("ids");
> > LOG.info(header+"body:"+body);
> >
> >   return
> > exchange.getContext().getTypeConverter().convertTo(Iterator.class,
> value);
> >
> > }
> >
> >
> >
> > }
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/how-to-execte-jdbc-IN-clause-statement-tp5759495p5759506.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Duplicate Elimination

2014-12-03 Thread David Karlsen
Just combine the two currencies into one string and use that as the unique
value...

2014-12-03 9:52 GMT+01:00 contactreji :

> Hi
>
> I have a requirement where I need to omit duplicate records. Consider
> sample
> below
>
> *
> 
> INR
> USD
> 60.2
> 
> 
> INR
> USD
> 58.2
> 
> 
> YEN
> INR
> .52
> 
> 
> SAR
> INR
> 16.50
> 
> *
>
>
>
> Now what i wanna do is remove all duplicates. As well as if there is same
> pair of Source and TargetCurrency , I want to send ahead the first record
> and drop others.
>
> Output shud be like
>
> *
> 
> INR
> USD
> 60.2
> 
> 
> YEN
> INR
> .52
> 
> 
> SAR
> INR
> 16.50
> 
> *
>
> Is there any camel component which can help me achieve this??
>
> Is there away I can use Idempotent Consumer. Cuz I saw that in idempotent
> consumer, we can use only 1 unique value to verify duplicacy. Can i use 2
> set of values to verify duplicacy?
> Ex - I want to allow only one set of USD->INR rate once in a day.
>
> Cheers
> Reji
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Duplicate-Elimination-tp5760020.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Duplicate Elimination

2014-12-04 Thread David Karlsen
Sure - some XSLT will do it - and it becomes a string.
I opened an issue some time ago about having the possibility to make the
messageId a complex object, possibly holding several keys:
https://issues.apache.org/jira/browse/CAMEL-7461

2014-12-03 12:44 GMT+01:00 contactreji :

> Thanks David
>
> A littlemore cleaner way was to use XSLT transformation. I was just
> interested in knowing if there is any provisions in Camel itself. Was
> trying
> to explore if idempotent consumer can work with more than 1 parameters as
> identifier.
>
> Following XSL code did the magic!
>
> * xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> *
>
>
> Cheers
> Reji
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Duplicate-Elimination-tp5760020p5760047.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Cryptography - real world use

2014-12-24 Thread David Karlsen
Sure! The crypto is agnostic of transport and payload - stick it in between
the marshalling and the endpoint - and inbetween endpoint and unmarshalling
and you should be fit for fight.
Good luck!

2014-12-24 11:17 GMT+01:00 James Green :
>
> I'm looking at Camel's CryptoDataFormat and am wondering to what extent we
> might employ it.
>
> In our use-case we want multiple Camel-powered JARs to send each other
> messages via a message broker. Some of message needs to remain private so
> cryptography needs to be used. Right now we have routes that produce and
> consume from brokers and use jaxb classes for mapping to/from POJOs.
>
> http://camel.apache.org/crypto.html Does not really deal with anything
> realistic - only mock endpoints. Can this be put into the above
> applications?
>
> Thanks,
>
> James
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Cryptography - real world use

2014-12-24 Thread David Karlsen
Yes - you got it - maybe an jaxbUnmarshaller if your byBusinessProcessor
returns an jaxb object.
Get that to work first - then you might want to use
http://camel.apache.org/binding.html as well (which is really just
syntactic sugar to make the dataformat a property of the endpoint/transport.

2014-12-24 11:29 GMT+01:00 James Green :
>
> So something like:
>
>
> from("the.input.queue").unmarshal(cryptoDataFormat).unmarshal(jaxbMapper).process(byBusinessProcessor).marshal(cryptoDataFormat).to("the.output.queue")
> ?
>
> Not entirely convinced I have this mentally modelled yet...
>
> On 24 December 2014 at 10:22, David Karlsen 
> wrote:
>
> > Sure! The crypto is agnostic of transport and payload - stick it in
> between
> > the marshalling and the endpoint - and inbetween endpoint and
> unmarshalling
> > and you should be fit for fight.
> > Good luck!
> >
> > 2014-12-24 11:17 GMT+01:00 James Green :
> > >
> > > I'm looking at Camel's CryptoDataFormat and am wondering to what extent
> > we
> > > might employ it.
> > >
> > > In our use-case we want multiple Camel-powered JARs to send each other
> > > messages via a message broker. Some of message needs to remain private
> so
> > > cryptography needs to be used. Right now we have routes that produce
> and
> > > consume from brokers and use jaxb classes for mapping to/from POJOs.
> > >
> > > http://camel.apache.org/crypto.html Does not really deal with anything
> > > realistic - only mock endpoints. Can this be put into the above
> > > applications?
> > >
> > > Thanks,
> > >
> > > James
> > >
> >
> >
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
> >
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Rollback / Transactions for File operations

2015-01-23 Thread David Karlsen
You can have a look at http://commons.apache.org/proper/commons-transaction/
and possibly my adaption into a spring PlatformTransactionManager of it:
https://github.com/davidkarlsen/Commons-Transaction-Spring-Integration

2015-01-23 17:35 GMT+01:00 arnoldmad :

> Hi !
>
> I have a simple application that contains of 2 parts. a HttpSender
> application that polls a local directory and should send the files via http
> to another application (HttpReceiver) that will write the files again to
> the
> disk.
>
> Here are the 2 routes:
> Sender:
>
> from("file:in?noop=false")
> .to("http4:localhost:4711/receiver");
>
> Receiver:
>
> from("jetty:http://localhost:4711/receiver";)
> .to("file:out");
>
>
> My issue is that the transfer is done via the internet end that the
> connection drops and I get incomplete files on the receiver side.
> What do I need to do on my routes to make this a "transaction" so that if
> an
> exception / incomplete transfer occures the incomplete files are getting
> deleted on the out folder and the sender gets notified to retransmit the
> file ?
>
> Thanks for your help
>
> yours
>
> Arnold
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Rollback-Transactions-for-File-operations-tp5762065.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


skipDuplicate/removeOnFailure flags for file2 component

2015-01-29 Thread David Karlsen
The docs on http://camel.apache.org/file2.html says it contains support
for idempotent-consumer built directly into the component - but it does not
expose the flags skipDuplicate/removeOnFailure which the idempotent
consumer does:
http://camel.apache.org/idempotent-consumer.html

is there any chance to add support for this - or is there a reason for it?

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: camel-jackson unmarshalling question

2015-04-29 Thread David Karlsen
It can probably be done by adding jackson annotations:
http://wiki.fasterxml.com/JacksonAnnotations "Polymorphic ...:"


2015-04-29 7:54 GMT+02:00 Claus Ibsen :

> Hi
>
> No this is not supported today.
>
> Though we could maybe add that, so you can configure this on the data
> format.
>
> On Mon, Apr 27, 2015 at 1:05 AM, Ryan Moquin 
> wrote:
> > Hi, I had a question about unmarshalling a json object to a generic class
> > type, such as something like, MyClass.  Due to erasure, Jackson
> > provides a special way of unmarshalling this type object so that you
> don't
> > lose the generic type information, like this:
> >
> > MyClass myClass = mapper.readValue(json, new
> > TypeReference>() {});
> >
> > Is there anyway to do this with the camel dataformat dsl?  Or does the
> > unmarshalling have to be done manually someway?
> >
> > Thanks for help in advance!
> >
> > Ryan
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: XML validation with Camel (multiple XSDs)

2017-08-10 Thread David Karlsen
We've done the same thing - and went with xpath and CBR - works fine.

2017-08-10 16:41 GMT+02:00 Burkard Stephan :

> Hi
>
> I have a use case where multiple different XML schema files exist (for
> different types of messages or schema versions). Whenever a message
> arrives, I have to validate it against the correct schema. The correct
> schema is derived from the message namespace.
>
>==> use A.xsd
>
>==> use B.xsd
>
>==> use Bv2.xsd
>
> Ways to implement this:
> - Query the document namespace with xpath and use a content based router
> to use Camel Validator with the correct schema file
> - Build a validation bean with a schema map (namespace as key) and do the
> validation in the bean
>
> Are there other/better/easier ways to implement this?
>
> Thanks
> Stephan
>
>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Spring boot gives null pointer in xml based camel configutaions

2018-06-27 Thread David Karlsen
No - it is not wrong to create .war's:
https://docs.spring.io/spring-boot/docs/1.5.14.RELEASE/reference/htmlsingle/#howto-create-a-deployable-war-file
- but not the most common deployment model.

Anyway - we're drifting away from the original problem which is the NPE in
the CamelBeanPostProcessor.postProcessBeforeInitialization(
CamelBeanPostProcessor.java:159).

There seems to be others that have the very same problem:
https://medium.freecodecamp.org/configure-multiple-camel-context-in-spring-boot-application-d3a16396266

>From http://camel.apache.org/spring-boot.html,  "Adding XML Routes",  there
seems to possible to load xml-based routes from a common place - but these
are *routes* not contexts.
This is a vanilla spring+camel app which is being migrated to boot+camel

Is it safe to say that multiple *Camel Contexts* is not supported when
using boot? Is it by design or should an issue be opened?
The way to migrate this is maybe to try to remove the camel context parts,
and be left with the xml-based routes and follow the pattern in "Adding XML
routes" as described above?


Den ons. 27. jun. 2018 kl. 17:18 skrev Doug Douglass <
douglass.d...@gmail.com>:

> On Wed, Jun 27, 2018 at 12:18 AM Claus Ibsen 
> wrote:
>
> > Hi
> >
> > Its a bit confusing what you do. Are you really packaging spring-boot
> > inside a WAR file and then deploying that to Jetty?
> > If so this is wrong. Spring Boot is a standalone runtime which you
> > should not embed in others.
> >
>
> While perhaps not directly related to the users NPE problem...
>
> It is not "wrong" to package a Spring Boot-based app as a WAR and deploy to
> a container, though it certainly isn't the usual way.
>
> On a recent project (ended last year) using Spring Boot 1.5.4.RELEASE and
> Camel 2.19.1, the deployment environment dictated WARs deployed to Tomcat
> servers. This required changing the packaging in the POM to war, setting
> the spring-boot-starter-tomcat dependency to provided so as not to include
> conflicting tomcat classes in the WARs, and modifying the application
> classes as follows:
>
> @SpringBootApplication
> public class MyApplication
> extends SpringBootServletInitializer {
> public static void main(String[] args) {
> ApplicationContext applicationContext = new SpringApplication(MyApplication
> .class).run(args);
> CamelSpringBootApplicationController applicationController =
> applicationContext.getBean(CamelSpringBootApplicationController.class);
> applicationController.run();
> }
>
> @Override
> protected SpringApplicationBuilder
> configure(SpringApplicationBuilder builder) {
>builder.sources(MyApplication.class);
>return builder;
> }
>
> ...
> }
>
> The main method allows running the application from Eclipse/STS or the
> spring-boot maven plugin. Extending SpringBootServletInitializer and
> overriding configure() allows the app to initialize correctly when deployed
> to a container. Note that all the applications used Java config for both
> Spring and Camel routes.
>
> YMMV if using Spring Boot 2
>
>
> >
> > On Sun, Jun 24, 2018 at 9:44 PM, Mohit Sharma 
> > wrote:
> > >
> > > Hi All,
> > >
> > > My name is Mohit and I am working with EVRY AS Norway<
> > https://www.evry.com/> .
> > >
> > > I am trying to upgraded existing Spring application based web
> > application running on jetty to Spring boot. I have updated dependencies
> > (respective pom's).
> > >
> > > Now when I am running jetty, it give error for camel related
> > configuration, ex of camel configuration which is working on spring
> > >
> > > Context file with camel configurations :
> > >
> > > 
> > > http://www.springframework.org/schema/beans";
> > >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > xmlns:util="http://www.springframework.org/schema/util";
> > >xmlns:context="http://www.springframework.org/schema/context";
> > >xmlns:camel="http://camel.apache.org/schema/spring";
> > >xsi:schemaLocation="http://www.springframework.org/schema/beans
> > http://www.springframework.org/schema/beans/spring-beans.xsd
> > >
> http://www.springframework.org/schema/util
> > http://www.springframework.org/schema/util/spring-util.xsd
> > >   http://camel.apache.org/schema/spring
> > http://camel.apache.org/schema/spring/camel-spring.xsd
> > >
> > http://www.springframework.org/schema/context
> > http://www.springframework.org/schema/context/spring-context.xsd";>
> > >
> > >  >
> class="com.edb.payment.pays.core.pwh.service.notification.NotificationServiceImpl"/>
> > >  >
> base-package="com.edb.payment.pays.core.pwh.service.notification.mapper"/>
> > >
> > >   > >
> > class="com.edb.finance.common.spring.jms.support.WmqDestinationResolver">
> > >  
> > >   > static-field="com.ibm.msg.client.wmq.WMQConstants.WMQ_TARGET_DEST_MQ"/>
> > >  
> > >  
> > >   > static-field="com.ibm.msg.clien

Re: Spring boot gives null pointer in xml based camel configutaions

2018-06-27 Thread David Karlsen
Over time yes, right now we just want a working MVP with as few changes as
possible to get it bootified, then make it more bootiful, and in that
respect we have the question I posted in the last mail.

Den ons. 27. jun. 2018 kl. 20:46 skrev Mark Nuttall :

> Can you switch to Java routes instead XML? I am deploying Spring Boot Camel
> Java routes as war's with no issues.
>
> On Wed, Jun 27, 2018 at 2:09 PM, David Karlsen 
> wrote:
>
> > No - it is not wrong to create .war's:
> > https://docs.spring.io/spring-boot/docs/1.5.14.RELEASE/
> > reference/htmlsingle/#howto-create-a-deployable-war-file
> > - but not the most common deployment model.
> >
> > Anyway - we're drifting away from the original problem which is the NPE
> in
> > the CamelBeanPostProcessor.postProcessBeforeInitialization(
> > CamelBeanPostProcessor.java:159).
> >
> > There seems to be others that have the very same problem:
> > https://medium.freecodecamp.org/configure-multiple-camel-
> > context-in-spring-boot-application-d3a16396266
> >
> > From http://camel.apache.org/spring-boot.html,  "Adding XML Routes",
> > there
> > seems to possible to load xml-based routes from a common place - but
> these
> > are *routes* not contexts.
> > This is a vanilla spring+camel app which is being migrated to boot+camel
> >
> > Is it safe to say that multiple *Camel Contexts* is not supported when
> > using boot? Is it by design or should an issue be opened?
> > The way to migrate this is maybe to try to remove the camel context
> parts,
> > and be left with the xml-based routes and follow the pattern in "Adding
> XML
> > routes" as described above?
> >
> >
> > Den ons. 27. jun. 2018 kl. 17:18 skrev Doug Douglass <
> > douglass.d...@gmail.com>:
> >
> > > On Wed, Jun 27, 2018 at 12:18 AM Claus Ibsen 
> > > wrote:
> > >
> > > > Hi
> > > >
> > > > Its a bit confusing what you do. Are you really packaging spring-boot
> > > > inside a WAR file and then deploying that to Jetty?
> > > > If so this is wrong. Spring Boot is a standalone runtime which you
> > > > should not embed in others.
> > > >
> > >
> > > While perhaps not directly related to the users NPE problem...
> > >
> > > It is not "wrong" to package a Spring Boot-based app as a WAR and
> deploy
> > to
> > > a container, though it certainly isn't the usual way.
> > >
> > > On a recent project (ended last year) using Spring Boot 1.5.4.RELEASE
> and
> > > Camel 2.19.1, the deployment environment dictated WARs deployed to
> Tomcat
> > > servers. This required changing the packaging in the POM to war,
> setting
> > > the spring-boot-starter-tomcat dependency to provided so as not to
> > include
> > > conflicting tomcat classes in the WARs, and modifying the application
> > > classes as follows:
> > >
> > > @SpringBootApplication
> > > public class MyApplication
> > > extends SpringBootServletInitializer {
> > > public static void main(String[] args) {
> > > ApplicationContext applicationContext = new SpringApplication(
> > MyApplication
> > > .class).run(args);
> > > CamelSpringBootApplicationController applicationController =
> > > applicationContext.getBean(CamelSpringBootApplicationController.class);
> > > applicationController.run();
> > > }
> > >
> > > @Override
> > > protected SpringApplicationBuilder
> > > configure(SpringApplicationBuilder builder) {
> > >builder.sources(MyApplication.class);
> > >return builder;
> > > }
> > >
> > > ...
> > > }
> > >
> > > The main method allows running the application from Eclipse/STS or the
> > > spring-boot maven plugin. Extending SpringBootServletInitializer and
> > > overriding configure() allows the app to initialize correctly when
> > deployed
> > > to a container. Note that all the applications used Java config for
> both
> > > Spring and Camel routes.
> > >
> > > YMMV if using Spring Boot 2
> > >
> > >
> > > >
> > > > On Sun, Jun 24, 2018 at 9:44 PM, Mohit Sharma  >
> > > > wrote:
> > > > >
> > > > > Hi All,
> > > > >
> > > > > My name is Mohit and I am working with EVRY AS Norway<
> > > > https://www.evry.com/>

Re: split(), shareUnitOfWork & transacted()

2018-07-20 Thread David Karlsen
They won't share transactions as these are backed by spring and kept as
threadlocals

Den fre. 20. jul. 2018, 01:07 skrev Iglehart, Vince <
vince.igleh...@kniferiver.com>:

> I have a question on propagating a transaction with split() and
> shareUnitOfWork(). I have a route defined below in Camel 2.20.2.  I read
> transactions from Datasource1, I split the result set, send each row to a
> recipient list which uses Datasource2, and then mark the row as processed.
> I perform a select for update when reading the transactions from
> Datasource1.
>
> from("seda:process")
> .transacted("TRANS_REQUIRESNEW")
>
> // Select all transactions to process
>
> .to("sql:classpath:sql/SelForUpdate.sql?dataSource=DataSource1")
> .split(body())
> .shareUnitOfWork()
> .setHeader("transactionId",
> simple("${body.transactionId}"))
>
> // Datasource2 recipients
>
> .recipientList().method(Routing.class).shareUnitOfWork().end()
>
> // Update dateProcessed.
>
> .to("sql:classpath:sql/UpdateDateProcessed.sql?dataSource=DataSource1");
>
> I want the "select for update" and the "update" to take place in the same
> transaction.  Through the use of the transacted() and shareUnitOfWork()
> calls, I would expect that select and update would be using the same
> connection to Oracle.  However, it appears that there are two connections
> being used - 1 for the select for update and 1 for the update.  Upon
> running the update inside of the split(), the route waits for the release
> from the select for update.
>
> Do I have the route and Spring context config correct?
>
> The Spring context file has the following configuration for the
> datasources.
>
>
>  jndi-name="jdbc/Datasource1"/>
>  jndi-name="jdbc/Datasource2"/>
>
>  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
> 
> 
>
>  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
> 
> 
>
>  class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>   
>class="org.springframework.data.transaction.ChainedTransactionManager">
>   
> 
>  bean="datasource1TxManager"/>
>  bean="datasource2TxManager"/>
> 
> 
> 
> 
>  value="PROPAGATION_REQUIRES_NEW"/>
> 
>
>
> Thanks
>
>
>


Re: [ANNOUNCEMENT] Apache Camel 2.23.1 Released

2019-01-18 Thread David Karlsen
There are some 2.23.0 links on
http://camel.apache.org/camel-2231-release.html

Den fre. 18. jan. 2019 kl. 08:55 skrev Gregor Zurowski <
gre...@list.zurowski.org>:

> The Camel community announces the immediate availability of the Camel
> 2.23.1 patch release. This release contains 33 fixes and improvements
> applied in the past weeks on the 2.23.x branch.
>
> The artifacts are published and ready for you to download [1] either
> from the Apache mirrors or from the Central Maven repository. For more
> details please take a look at the release notes [2, 3].
>
> Many thanks to all who made this release possible.
>
> On behalf of the Camel PMC,
> Gregor Zurowski
>
> [1] http://camel.apache.org/download.html
> [2] http://camel.apache.org/camel-2231-release.html
> [3]
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12344567&projectId=12311211
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Jasypt Support in Spring Boot

2019-06-08 Thread David Karlsen
There is a component for integrating boot and jasypt (don't have the link
here now) try that instead.

lør. 8. jun. 2019, 03:56 skrev Stanley Brown :

> Hi,
>
> I'm receiving the following error trying to use Jasypt and the
> BridgePropertyPlaceholderConfigurer from a XML configuration in a Spring
> Boot application:
>
> ***
> APPLICATION FAILED TO START
> ***
> Description:
> Parameter 1 of method properties in
> org.apache.camel.spring.boot.CamelAutoConfiguration required a single bean,
> but 3 were found:
> - jasypt: defined in class path resource
> [spring/ws-proxy-security.xml]
> - bridgePropertyPlaceholder: defined in class path resource
> [spring/ws-proxy-security.xml]
> - propertiesParser: defined by method 'propertiesParser' in class
> path resource [org/apache/camel/spring/boot/CamelAutoConfiguration.class]
>
> Action:
> Consider marking one of the beans as @Primary, updating the consumer to
> accept multiple beans, or using @Qualifier to identify the bean that should
> be consumed
>
>
> My Jasypt configuration is as follows:
>
>class="org.apache.camel.component.jasypt.JasyptPropertiesParser">
> 
> 
>   
>
>class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
>  value="file:${karaf.home}${sis.configFile:admissions.cfg}"/>
> 
>   
>
> I'm using:
> Camel 2.24 (with with camel-jasypt-starter and camel-spring-boot-starter
> dependencies)
> Spring Boot 2.1.5.RELEASE
>
>
> I know that there was a fix in Fuse Integration Services (FIS) 2.0.
> Here's the link https://access.redhat.com/solutions/3415021 for that
> issue.  I was wondering if there was a fix or workaround for this issue
> that supports using Camel in Spring Boot without requiring FIS.
>
> Also, Jasypt decryption works if it's configured within Spring Boot, but
> only on the property placeholders within the CamelContext, not the Spring
> property placeholders.  The Spring Boot configuration is simply:
>
> @Bean(name = "encryptorBean")
> public StringEncryptor createEncryptor() {
> StandardPBEStringEncryptor encryptor = new
> StandardPBEStringEncryptor();
> encryptor.setAlgorithm("PBEWithMD5AndDES");
> encryptor.setPassword(System.getenv("password"));
>
> return encryptor;
> }
>
>
> Thanks for your help.
>
>


camel3 properties component?

2019-07-21 Thread David Karlsen
See [*] for validation error by the camel maven plugin for the properties
component.
Has this been removed in camel3? What is the new syntax/replacement?



[*]

[INFO] Detected Camel version used in project: 3.0.0-M4
[INFO] Validating using Camel version: 3.0.0-M4
[INFO] Endpoint validation passsed at:
com.edb.fs.tac.jfr.srv.batch.dhub.DhubUploadRouteBuilder.configure(DhubUploadRouteBuilder.java:16)

direct:uploadEndpoint


[INFO] Endpoint validation passsed at:
com.edb.fs.tac.jfr.srv.batch.dhub.DhubUploadRouteBuilder.configure(DhubUploadRouteBuilder.java:24)

{{dhub.export.uploadUri}}


[INFO] Endpoint validation success: (1 = passed, 0 = invalid, 1 =
incapable, 0 = unknown components, 0 = deprecated options)
[WARNING] Simple validation error at:
com.edb.fs.tac.jfr.srv.batch.dhub.DhubUploadRouteBuilder.configure(DhubUploadRouteBuilder.java:23)

Unexpected token p at location 0
properties:dhub.export.doUpload:false
*

[WARNING] Simple validation error: (0 = passed, 1 = invalid)
[INFO] Endpoint pair (seda/direct) validation success (0 = pairs)
[INFO] Duplicate route id validation success (0 = ids)
[INFO]

[INFO] BUILD FAILURE
[INFO]

[INFO] Total time:  12.445 s (Wall Clock)
[INFO] Finished at: 2019-07-21T12:13:29+02:00
[INFO]

[ERROR] Failed to execute goal
org.apache.camel:camel-report-maven-plugin:3.0.0-M4:validate (default) on
project jfr-srv-batch: Endpoint validation success: (1 = passed, 0 =
invalid, 1 = incapable, 0 = unknown components, 0 = deprecated options)
[ERROR] Simple validation error: (0 = passed, 1 = invalid)
[ERROR] Duplicate route id validation success (0 = ids)
[ERROR] Endpoint pair (seda/direct) validation success (0 = pairs)
[ERROR] -> [Help 1]

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: camel3 properties component?

2019-07-21 Thread David Karlsen
Thanks - it passes now!

søn. 21. jul. 2019 kl. 12:58 skrev Claus Ibsen :

> Make sure you use
>
> ${xxx} in the simple syntax for Camel 3
>
> On Sun, Jul 21, 2019 at 12:15 PM David Karlsen 
> wrote:
> >
> > See [*] for validation error by the camel maven plugin for the properties
> > component.
> > Has this been removed in camel3? What is the new syntax/replacement?
> >
> >
> >
> > [*]
> >
> > [INFO] Detected Camel version used in project: 3.0.0-M4
> > [INFO] Validating using Camel version: 3.0.0-M4
> > [INFO] Endpoint validation passsed at:
> >
> com.edb.fs.tac.jfr.srv.batch.dhub.DhubUploadRouteBuilder.configure(DhubUploadRouteBuilder.java:16)
> >
> > direct:uploadEndpoint
> >
> >
> > [INFO] Endpoint validation passsed at:
> >
> com.edb.fs.tac.jfr.srv.batch.dhub.DhubUploadRouteBuilder.configure(DhubUploadRouteBuilder.java:24)
> >
> > {{dhub.export.uploadUri}}
> >
> >
> > [INFO] Endpoint validation success: (1 = passed, 0 = invalid, 1 =
> > incapable, 0 = unknown components, 0 = deprecated options)
> > [WARNING] Simple validation error at:
> >
> com.edb.fs.tac.jfr.srv.batch.dhub.DhubUploadRouteBuilder.configure(DhubUploadRouteBuilder.java:23)
> >
> > Unexpected token p at location 0
> > properties:dhub.export.doUpload:false
> > *
> >
> > [WARNING] Simple validation error: (0 = passed, 1 = invalid)
> > [INFO] Endpoint pair (seda/direct) validation success (0 = pairs)
> > [INFO] Duplicate route id validation success (0 = ids)
> > [INFO]
> > 
> > [INFO] BUILD FAILURE
> > [INFO]
> > 
> > [INFO] Total time:  12.445 s (Wall Clock)
> > [INFO] Finished at: 2019-07-21T12:13:29+02:00
> > [INFO]
> > 
> > [ERROR] Failed to execute goal
> > org.apache.camel:camel-report-maven-plugin:3.0.0-M4:validate (default) on
> > project jfr-srv-batch: Endpoint validation success: (1 = passed, 0 =
> > invalid, 1 = incapable, 0 = unknown components, 0 = deprecated options)
> > [ERROR] Simple validation error: (0 = passed, 1 = invalid)
> > [ERROR] Duplicate route id validation success (0 = ids)
> > [ERROR] Endpoint pair (seda/direct) validation success (0 = pairs)
> > [ERROR] -> [Help 1]
> >
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Problems with sftp in Camel 2.11.0

2013-04-29 Thread David Karlsen
Probably if the RC's are available off central the testing/use of them
would increase.


2013/4/29 Claus Ibsen 

> Hi Bengt
>
> Thanks for the patches et. all.
>
> I just want to remind you and others listening that we did 4 RC rounds
> of the 2.11.0 release, so it would be ideal if people had tested the
> RC's. Otherwise there is less points in us doing all the RC rounds if
> the community dont react and help test it. After all its going to run
> in *YOUR* business. So take action and help test the software.
>
> There is a 2.10 patch release scheduled to be released first. So the
> 1st patch for 2.11 is scheduled sometime after this release.
>
>
>
>
> On Thu, Apr 25, 2013 at 9:38 AM, Bengt Rodehav  wrote:
> > I have now uploaded patches for fixing FileUtil and for testing the error
> > in FileUtilTest.
> >
> > Like I wrote before, I think this is a really serious error since it
> > affects (at least) ftp, ftps and sftp. I would really appreciate if a
> > 2.11.1 bugfix release could happen real soon. I don't think that
> > ftp/ftps/sftp can be safely used at all in 2.11.0.
> >
> > /Bengt
> >
> >
> >
> >
> > 2013/4/24 Christian Müller 
> >
> >> Hey Guys,
> >>
> >> thanks for reporting.
> >> Could you provide a unit test which shows this issue (may directly for
> the
> >> FileUtil class). Ans like always, patches are welcome and help us to fix
> >> this issue soon.
> >>
> >> http://camel.apache.org/contributing.html
> >>
> >> Best,
> >> Christian
> >>
> >>
> >> On Wed, Apr 24, 2013 at 11:28 AM, Bengt Rodehav 
> wrote:
> >>
> >> > I created a JIRA for this:
> >> >
> >> > https://issues.apache.org/jira/browse/CAMEL-6309
> >> >
> >> > /Bengt
> >> >
> >> >
> >> > 2013/4/24 Bengt Rodehav 
> >> >
> >> > > Also, note that the "stepwise" option does not affect the bug I have
> >> > > enountered. What happens for me is that Camel traverses the path to
> get
> >> > > down to the subdirectory in order to verity that the subdirectory
> >> exists
> >> > > (or create it). Then when Camel tries to return to the original
> >> directory
> >> > > the error happens since it thinks that the original directory is
> "//"
> >> and
> >> > > not "/" as it should be.
> >> > >
> >> > > /Bengt
> >> > >
> >> > >
> >> > > 2013/4/24 Bengt Rodehav 
> >> > >
> >> > >> Hello Diether,
> >> > >>
> >> > >> The error you mention looks very similar to mine. However, you use
> ftp
> >> > >> (and thus FtpOperations) while I use sftp (and SftpOperations). I
> >> > haven't
> >> > >> checked if they handle subdirectories in a similar way. I'm afraid
> >> that
> >> > the
> >> > >> bug might affect many components since it is in camel-core
> (FileUtil
> >> > >> class). Have you tried Camel 2.11.0 to verify if it works for you?
> >> > >>
> >> > >> I think whati will cause my problem is if you upload to a
> subdirectory
> >> > >> via sftp and the home directory (where you end up after login) is
> "/"
> >> > (or
> >> > >> "\" on windows).
> >> > >>
> >> > >> /Bengt
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >> 2013/4/24 Diether 
> >> > >>
> >> > >>>
> >> > >>> This problem has been mentioned before:
> >> > >>>
> >> > >>>
> >> >
> >>
> http://camel.465427.n5.nabble.com/Producing-files-to-ftp-now-working-in-2-10-3-td5726060.html
> >> > >>>
> >> > >>> But it seems like still no fix has been implemented then.
> >> > >>> For us it was working in 2.10.2 though, but not in 2.10.3
> >> > >>>
> >> > >>> Regards,
> >> > >>> Diether
> >> > >>>
> >> > >>> 
> >> > >>> Van: Bengt Rodehav [via Camel] [
> >> > ml-node+s465427n5731408...@n5.nabble.com
> >> > >>> ]
> >> > >>> Verzonden: woensdag 24 april 2013 10:28
> >> > >>> To: Wuyts Diether
> >> > >>> Onderwerp: Re: Problems with sftp in Camel 2.11.0
> >> > >>>
> >> > >>> I investigated this further and found a serious bug in the
> >> > >>> FileUtil.compactPath() method. If the path only contains a "/" (or
> >> "\"
> >> > on
> >> > >>> Windows) the compactPath() method will:
> >> > >>>
> >> > >>> - Determine that the path both starts and ends with a slash.
> >> > >>> - First output a slash because the path starts with a slash
> >> > >>> - Then output whatever comes after the leading slash (in this case
> >> > >>> nothing)
> >> > >>> - Last output a slash because the path ends with a slash, thus
> ending
> >> > up
> >> > >>> with two slashes which is incorrect
> >> > >>>
> >> > >>> The logic always assume that there is some other content in
> between
> >> the
> >> > >>> starting and ending slash. This will of course fail if the path
> only
> >> > >>> consists of a single slash (or backslash).
> >> > >>>
> >> > >>> From what I can see this error was introduced in revision 1389069
> on
> >> > >>> September 23, 2012. This means that it probably doesn't work on
>  any
> >> > >>> version from (and including) Camel 2.10.2. The version we have in
> >> > >>> production is Camel 2.7.1 which is why I haven't seen this problem
> >> > >>> before.
> >> > >>> I was now hoping to upgrade to the latest

Re: Where to download camel 2.11.1 jars

2013-05-10 Thread David Karlsen
AFAIK it is not released yet. Try the 2.11.1–SNAPSHOT version. Or one of
the other snapshot versions.
Den 10. mai 2013 09:39 skrev "preety somani" 
følgende:

> Hi,
>
>   I want to use features of camel2.11.1 to set the soap version in camel
> spring ws for a soap end point. But not able to find the download for came
> 2.11.1 version.
>
> Thansk,
> Preety
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Where-to-download-camel-2-11-1-jars-tp5732244.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Spring 2.11 + JDK 1.7_u17

2013-05-31 Thread David Karlsen
Do you have an old jaxb-impl in your application? You could also update
your jdk patch level.
Den 31. mai 2013 08:37 skrev "Jose"  følgende:

> Hi,
>
> I am using camel-spring with JKD 1.7.0_17 and I am getting a
> NullPointerException when the applicationContext is parsed. This is the
> trace:
>
> org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
> exception parsing XML document from class path resource
> [spring/applicationContext.xml]; nested exception is
> java.lang.NullPointerException
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
> at
>
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
> at
>
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
> at
>
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
> at
>
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
> at
>
> org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
> at
>
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
> at
>
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530)
> at
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444)
> at
>
> org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)
> at
>
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
> at
>
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
> at
>
> com.oracle.weblogic.wsee.wrapper.org.springframework.web.context.ContextLoaderListener.contextInitialized(Unknown
> Source)
> at
>
> weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:582)
> at
>
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
> at
> weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
> at
>
> weblogic.servlet.internal.EventsManager.executeContextListener(EventsManager.java:233)
> at
>
> weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:190)
> at
>
> weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:175)
> at
>
> weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1730)
> at
>
> weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740)
> at
>
> weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704)
> at
> weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
> at
>
> weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
> at
>
> weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
> at
>
> weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
> at
>
> weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
> at
>
> weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:212)
> at
>
> weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:111)
> at
>
> weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
> at
>
> weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
> at
>
> weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
> at
>
> weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
> at
>
> weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
> at
>
> weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
> at
>
> weblogic.application.internal.BaseDeployment$2.next(Bas

Re: Camel always sending MQRFH2 headers to target WebsphereMQ queue.

2013-06-04 Thread David Karlsen
Does this help?
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fmi21980_.htm


2013/6/3 shashi.kant 

> I have been trying to send message to a IBM websphere MQ queue which has to
> be in IBM500 charset, MQFMT_STRING format and encoding 273 from a Camel
> 2.10.4 application running on jboss. tried General ways of setting the
> connectionfactory properly with following values:
> connection.setTransportType(JMSC.MQJMS_CLIENT_NONJMS_MQ);
> connection.setStringProperty(WMQConstants.JMS_IBM_CHARACTER_SET, "500");
> connection.setStringProperty(WMQConstants.JMS_IBM_FORMAT,
> MQC.MQFMT_STRING);
> connection.setIntProperty(WMQConstants.JMS_IBM_ENCODING, 273);
> connection.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE,
> WMQConstants.WMQ_CLIENT_NONJMS_MQ); I have tried
> IBMWebSphereMqDestinationResolver
>
> https://jira.springsource.org/secure/attachment/12688/IBMWebSphereMqDestinationResolver.java
> But everytime at the Websphere MQ end MQRFH2 header is there. I can't
> figure
> out any solution to this problem.. Somebody please help me out.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-always-sending-MQRFH2-headers-to-target-WebsphereMQ-queue-tp5733725.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: JMS component performance issue with IBMMQ

2013-06-25 Thread David Karlsen
Are both MOMs using persistent messaging - persisting makes it a lot slower.


2013/6/25 Mohammad Shadab Ali 

> Hi Christian,
>
> I am using non ssl IBMMQ queue manager through a IBMMQ channel and kept
> the WMQConstants.DELIVERYMODE mode as 1 and TransportType as
> WMQConstants.WMQ_CM_CLIENT
>
>
>
> Regards,
> Shadab
>
>
>
> -Original Message-
> From: Christian Müller [mailto:christian.muel...@gmail.com]
> Sent: Monday, June 24, 2013 9:15 PM
> To: users@camel.apache.org
> Subject: Re: JMS component performance issue with IBMMQ
>
> You should share your configuration if you want help...
>
> Best,
> Christian
>
> Sent from a mobile device
> Am 24.06.2013 13:50 schrieb "Mohammad Shadab Ali" <
> mohammad.a...@genpact.com
> >:
>
> > Hi,
> >
> > I am facing a performance issue with JMS component when configured to
> > IBMMQ. I have a camel route JMS(ActiveMQ) to JMS(IBMMQ). The
> > processing rate of JMS(ActiveMQ) is around 300messages/sec, but
> > JMS(IBMMQ) is processing with just 35messages/sec. We receives around
> > 4 messages per day and this makes the processing of messages from
> the route very slow.
> > Any pointer on how to increase the performance of JMS component with
> > IMBMQ would be very helpful.
> >
> > Thanks in advance.
> >
> >
> >
> >
> > Regards,
> > Shadab
> >
> > 
> > *** This e-mail (and any attachments), is confidential and may be
> > privileged. It may be read, copied and used only by intended
> > recipients. Unauthorized access to this e-mail (or
> > attachments) and disclosure or copying of its contents or any action
> > taken in reliance on it is unlawful. Unintended recipients must notify
> > the sender immediately by e-mail/phone & delete it from their system
> > without making any copies or disclosing it to a third person.***
> >
> > This e-mail (and any attachments), is confidential and may be privileged.
> > It may be read, copied and used only
> > by intended recipients. Unauthorized access to this e-mail (or
> > attachments) and disclosure or copying of its contents or any action
> > taken in reliance on it is unlawful. Unintended recipients must notify
> > the sender immediately by e-mail/phone & delete it from their system
> > without making any copies or disclosing it to a third person.
> >
> >
>
> *** This e-mail (and any attachments), is confidential and may be
> privileged. It may be read, copied and used only
> by intended recipients. Unauthorized access to this e-mail (or
> attachments) and disclosure or copying of its
> contents or any action taken in reliance on it is unlawful. Unintended
> recipients must notify the sender immediately
> by e-mail/phone & delete it from their system without making any copies or
> disclosing it to a third person.***
> This e-mail (and any attachments), is confidential and may be privileged.
> It may be read, copied and used only
> by intended recipients. Unauthorized access to this e-mail (or
> attachments) and disclosure or copying of its
> contents or any action taken in reliance on it is unlawful. Unintended
> recipients must notify the sender immediately
> by e-mail/phone & delete it from their system without making any copies or
> disclosing it to a third person.
>
>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: conditional uri

2013-07-16 Thread David Karlsen
You could either make it configurable with placeholders:
http://camel.apache.org/using-propertyplaceholder.html

or use a when choice: http://camel.apache.org/spring-xml-extensions.html


2013/7/16 boris 

> How could I have a conditional uri string?
> For example,
> I have  for testing.
> I want to have a single xml file for both and manage uri string
> conditionally.
> Thanks,
> Boris
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/conditional-uri-tp5735724.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: save message across exchanges

2013-07-31 Thread David Karlsen
You could place a copy in a header or preferably a property.
Den 31. juli 2013 20:54 skrev "javamonkey79" 
følgende:

> Is there a way to store a message across exchanges?
>
> It seems like you should be able to put something in to the context, but
> I’m
> not seeing anything obvious.
>
> For now, I’m just using a bean to save off a static reference, but this
> seems sorta dirty.
>
> Thanks in advance.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/save-message-across-exchanges-tp5736593.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: camel-spring-batch 2.11.1 breaks previous working routes

2013-08-18 Thread David Karlsen
Can you provide a strippped down project or unit test that shows the error?


2013/8/16 Gardella juan 

> Hi all,
>
> I've used camel-spring-batch from a while. I recently upgrade from 2.11.0
> to
> 2.11.1 and the route that use camel-spring-batch have failed. I detect that
> the problem is in 2.11.1 after the execution of the job the headers are
> cleaned. So I changed my route to log the headers before and after execute
> the job:
>
> Route:
>
> [...]
> .log("Before: ${headers}")
> .to("spring-batch:myJob")
> .log("After: ${headers}")
> [...]
>
> And here is the log for the different versions:
>
> 2.11.0
> ==
> INFO  BatchProcessRouteBuilder.batch Before: {CamelFileLength=1833, [...]}
> INFO  o.s.b.c.l.support.SimpleJobLauncher Job: [FlowJob: [name=myJob]]
> launched with the following parameters: [{CamelFileLength=1833, [...]}]
> [...]
> INFO  o.s.b.c.l.support.SimpleJobLauncher Job: [FlowJob: [name=myJob]]
> completed with the following parameters: [{CamelFileLength=1833, [...]}]
> and
> the following status: [COMPLETED]
> INFO  BatchProcessRouteBuilder.batch After: {CamelFileLength=1833, [...]}
>
> 2.11.1
> ===
> INFO  BatchProcessRouteBuilder.batch Before: {CamelFileLength=1833, [...]}
> INFO  o.s.b.c.l.support.SimpleJobLauncher Job: [FlowJob: [name=myJob]]
> launched with the following parameters: [{CamelFileLength=1833,[...]}]
> [...]
> INFO  o.s.b.c.l.support.SimpleJobLauncher Job: [FlowJob: [name=myJob]]
> completed with the following parameters: [{CamelFileLength=1833,[...]}] and
> the following status: [COMPLETED]
> *INFO  BatchProcessRouteBuilder.batch After: {}*
>
> I marked in bold the problem. The headers are empty. Do I have to raise a
> JIRA ticket with this problem?
>
> Thanks,
> Juan
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-spring-batch-2-11-1-breaks-previous-working-routes-tp5737426.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Camel MQ help needed

2012-09-28 Thread David Karlsen
You can set that option directly on the ibm mq connection factory
Den 28. sep. 2012 18:52 skrev "realice"  følgende:

> thanks, turns out the mq queue needs a property of targetClient with a
> value
> of MQJMS_CLIENT_NONJMS_MQ(1), is there any way i can specify that in camel
> route? right now i have
>
> 
>
> do i just do
>
> http://camel.465427.n5.nabble.com/Camel-MQ-help-needed-tp5720158p5720210.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Error When Communicating with 3rd Party SOAP Service

2012-10-18 Thread David Karlsen
Are you on an old sun jdk? They have that problem. Upgrade to the latest
version.
Den 18. okt. 2012 17:38 skrev "James Carr" 
følgende:
>
> Hey All,
>
> I've used CXF for quite sometime and this week I was putting together
> a client for a 3rd party service and get the following error when
> trying to call the service:
>
> HTTP response '415: Cannot process the message because the content
> type 'text/xml; charset=UTF-8' was not the expected type
> 'application/soap+xml; charset=utf-8'.' when communicating with
> http//service.example.com/foo/bar
>
> Any ideas? Here is a simple snippet of the service call:
>
> JaxWsProxyFactoryBean factory = new
JaxWsProxyFactoryBean();
> factory.getInInterceptors().add(new
LoggingInInterceptor());
> factory.getOutInterceptors().add(new
LoggingOutInterceptor());
> factory.setServiceClass(ILoginService.class);
>
> factory.setAddress("
https://service4.example.com/services/LoginService";);
>
> ILoginService service = (ILoginService) factory.create();
> service.authenticate(new TokenRequest());
>
> Thanks,
> James


Re: ActiveMQ and WebSphereMQ

2012-10-26 Thread David Karlsen
it contains javax.jms because the jar contains the SPEC - the JMS API.
Then you add vendor jars to provide the connection factory implementations etc.

2012/10/26 Caa_man :
> Jens is right!
> I studied all dependencies which were loaded with ActiveMQ. One of
> dependencies is geronimo-jms_1.1_spec. This jar has javax.jms packages (WHY
> THE HELL???). As a result I removed geronimo jars from compiled archive and
> this change yielded application deployment to be Ok.
>
> 
> org.apache.activemq
> activemq-camel
> 5.7.0
> 
> 
> org.apache.activemq
> activemq-core
> 5.7.0
> 
> 
> org.apache.activemq
> activemq-pool
> 5.7.0
> 
> 
> org.apache.geronimo.specs
> geronimo-jms_1.1_spec
> 1.1.1
> provided
> 
> 
> org.apache.geronimo.specs
> geronimo-jta_1.0.1B_spec
> 1.0.1
> provided
> 
> 
> org.apache.geronimo.specs
> geronimo-j2ee-management_1.1_spec
> 1.0.1
> provided
> 
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ActiveMQ-and-WebSphereMQ-tp5721492p5721586.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Use @RunWith(CamelSpringJUnit4ClassRunner.class) & @UseAdviceWith + find Mocks after starting camel context

2012-10-30 Thread David Karlsen
Yes. This is possible and how we test in my shop. You can also disable jmx
for the test with @disableJmx which also adds value.
Have a nice Camel ride.
Den 30. okt. 2012 16:12 skrev "Cyril Lakech" 
følgende:

> Hi,
>
> I would like to use 3 excellent camel features together in my test:
>
> @RunWith(CamelSpringJUnit4ClassRunner.class) to use my spring config
>
> @UseAdviceWith to be able to change the behavior of a few endpoints dealing
> with remote http APIs
>
> And we would be able to retrieve mocks of other endpoints to test of
> course.
>
> Here is a sample :
>
> @RunWith(CamelSpringJUnit4ClassRunner.class)
> @UseAdviceWith
> public class PriceRouteBuilderTest {
>
> //given
>
>
>
> camelContext.getRouteDefinition("direct:in/prices").adviceWith(camelContext,
> new AdviceWithRouteBuilder() {
> @Override
> public void configure() throws Exception {
> mockEndpoints();
> includeRoutes(new MyExtraRoute());
>
> weaveById("direct:pointsOfSale").replace().to("direct:posTest");
> }
> });
> // we must manually start when we are done with all the advice with
> camelContext.start();
>
> //pointsOfSale.expectedBodiesReceived("TEST");
>
> //when
> inPrice.sendBody("TEST");
>
> //then
> MockEndpoint.assertIsSatisfied(camelContext);
>
> }
>
> Is it possible or not ?
>
> If not, what are your advice to do it ?
>
> Regards,
>
> Cyril Lakech
>
> --
> Ce message et toutes les pièces jointes sont établis à l'attention
> exclusive de leurs destinataires et sont confidentiels. Si vous recevez ce
> message par erreur, merci de le détruire et d'en avertir immédiatement
> l'expéditeur. L'internet ne permettant pas d'assurer l'intégrité de ce
> message, le contenu de ce message ne représente en aucun cas un engagement
> de la part de GROUPE ADEO.
>


Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread David Karlsen
I'm confused about how expectedBodiesReceived behaves.

I have a route where I mock a jms endpoint (the endpoint is sent to in
an onException route as follows:

 

java.lang.Exception

true




I then override the sending to inboundFromRtsErrorQueue by id in the
setup of my testclass.

Everything works ok:


mockInboundFromRtsErrorQueue.setExpectedMessageCount( 1 );
Exchange failedExchange =
mockInboundFromRtsErrorQueue.getExchanges().get( 0 );
Assert.assertEquals( payload, failedExchange.getIn().getBody() );
//mockInboundFromRtsErrorQueue.expectedBodiesReceived( payload
); //strangely this does not pass - but the above does
mockInboundFromRtsErrorQueue.assertIsSatisfied();


but I'm surprised that if I comment in the second-last line it will
fail. Why? As line no 2&3 does exactly the same??

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread David Karlsen
Same:

Body of message: 0. Expected: <:
> Try setting the expectation before you actually hit the endpoint with any
> messages. Hit the endpoint with your test logic. Then assert.
>
> Does it work then?
>
> Regards.
>
> Sent from a mobile device
> On 5 Nov 2012 20:27, "David Karlsen"  wrote:
>
>> I'm confused about how expectedBodiesReceived behaves.
>>
>> I have a route where I mock a jms endpoint (the endpoint is sent to in
>> an onException route as follows:
>>
>>  
>>
>> java.lang.Exception
>> 
>>
>> true
>> 
>> > id="inboundFromRtsErrorQueue"
>>
>> uri="jms:queue:{{rts.online.mq.reservationsReceiveErrorQueue}}?connectionFactory=#rtsConnectionFactory&destinationResolver=#rtsDestinationResolver"
>> />
>>
>>
>> I then override the sending to inboundFromRtsErrorQueue by id in the
>> setup of my testclass.
>>
>> Everything works ok:
>>
>>
>> mockInboundFromRtsErrorQueue.setExpectedMessageCount( 1 );
>> Exchange failedExchange =
>> mockInboundFromRtsErrorQueue.getExchanges().get( 0 );
>> Assert.assertEquals( payload, failedExchange.getIn().getBody() );
>> //mockInboundFromRtsErrorQueue.expectedBodiesReceived( payload
>> ); //strangely this does not pass - but the above does
>> mockInboundFromRtsErrorQueue.assertIsSatisfied();
>>
>>
>> but I'm surprised that if I comment in the second-last line it will
>> fail. Why? As line no 2&3 does exactly the same??
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread David Karlsen
Doesn't this code look suspicious (look at actual bodies):

public void expectedBodiesReceived(final List bodies) {
expectedMessageCount(bodies.size());
this.expectedBodyValues = bodies;
this.actualBodyValues = new ArrayList();

expects(new Runnable() {
public void run() {
for (int i = 0; i < expectedBodyValues.size(); i++) {
Exchange exchange = getReceivedExchange(i);
assertTrue("No exchange received for counter: " +
i, exchange != null);

Object expectedBody = expectedBodyValues.get(i);
Object actualBody = null;
if (i < actualBodyValues.size()) {
actualBody = actualBodyValues.get(i);
}
actualBody = extractActualValue(exchange,
actualBody, expectedBody);

assertEquals("Body of message: " + i,
expectedBody, actualBody);
}
}
    });
}

2012/11/5 David Karlsen :
> Same:
>
> Body of message: 0. Expected: <
> If I had the order like before (defining the asserts after the test)
> it read body of message: null
>
> 2012/11/5 Raul Kripalani :
>> Try setting the expectation before you actually hit the endpoint with any
>> messages. Hit the endpoint with your test logic. Then assert.
>>
>> Does it work then?
>>
>> Regards.
>>
>> Sent from a mobile device
>> On 5 Nov 2012 20:27, "David Karlsen"  wrote:
>>
>>> I'm confused about how expectedBodiesReceived behaves.
>>>
>>> I have a route where I mock a jms endpoint (the endpoint is sent to in
>>> an onException route as follows:
>>>
>>>  
>>>
>>> java.lang.Exception
>>> 
>>>
>>> true
>>> 
>>> >> id="inboundFromRtsErrorQueue"
>>>
>>> uri="jms:queue:{{rts.online.mq.reservationsReceiveErrorQueue}}?connectionFactory=#rtsConnectionFactory&destinationResolver=#rtsDestinationResolver"
>>> />
>>>
>>>
>>> I then override the sending to inboundFromRtsErrorQueue by id in the
>>> setup of my testclass.
>>>
>>> Everything works ok:
>>>
>>>
>>> mockInboundFromRtsErrorQueue.setExpectedMessageCount( 1 );
>>> Exchange failedExchange =
>>> mockInboundFromRtsErrorQueue.getExchanges().get( 0 );
>>> Assert.assertEquals( payload, failedExchange.getIn().getBody() );
>>> //mockInboundFromRtsErrorQueue.expectedBodiesReceived( payload
>>> ); //strangely this does not pass - but the above does
>>> mockInboundFromRtsErrorQueue.assertIsSatisfied();
>>>
>>>
>>> but I'm surprised that if I comment in the second-last line it will
>>> fail. Why? As line no 2&3 does exactly the same??
>>>
>>> --
>>> --
>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: transactional client vs transacted=true on a jms route?

2012-11-06 Thread David Karlsen
No one?
Are these equivalent?

2012/11/5 David J. M. Karlsen :
> Hi.
>
> I have a route where the from endpoint is jms based.
> The end of the route will be a jms endpoint as well.
> I also have errorhandling in an onException clause which will put the
> message on a third jms queue.
>
> So in short - jms in - jms out.
>
> I wanna protect this messagehandling with a jms transaction handler (all
> resources use the same connection factory so that messages cannot be lost.
>
> I can either configure the route to use  as described in:
> http://camel.apache.org/transactional-client.html.
>
> But I can also just configure the jms endpoints to use transacted=true as
> described in:
> http://camel.apache.org/jms.html
>
> is there any difference at all by configuring them either way?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/transactional-client-vs-transacted-true-on-a-jms-route-tp5722167.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: transactional client vs transacted=true on a jms route?

2012-11-06 Thread David Karlsen
No - not really - because the resource-local tx manager is also a
platformtransaction manager:
http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/jms/connection/JmsTransactionManager.html

So if you refer the same type of tx-mgr (a resource local
JmsTransactionManager one) it looks the same to me?


2012/11/6 Scott England-Sullivan :
> Hi David,
>
> No, they are not equivalent.  The transacted=true by itself initializes the
> container for simple local JMS Session transactions.
>
> The  element is used in conjunction with the Spring
> PlatformTransactionManager as defined on the Transaction
> Client<http://camel.apache.org/transactional-client.html>link you have
> referenced.
>
> Make sense?
>
> Best Regards,
> Scott ES
>
> On Tue, Nov 6, 2012 at 10:46 AM, David Karlsen wrote:
>
>> No one?
>> Are these equivalent?
>>
>> 2012/11/5 David J. M. Karlsen :
>> > Hi.
>> >
>> > I have a route where the from endpoint is jms based.
>> > The end of the route will be a jms endpoint as well.
>> > I also have errorhandling in an onException clause which will put the
>> > message on a third jms queue.
>> >
>> > So in short - jms in - jms out.
>> >
>> > I wanna protect this messagehandling with a jms transaction handler (all
>> > resources use the same connection factory so that messages cannot be
>> lost.
>> >
>> > I can either configure the route to use  as described in:
>> > http://camel.apache.org/transactional-client.html.
>> >
>> > But I can also just configure the jms endpoints to use transacted=true as
>> > described in:
>> > http://camel.apache.org/jms.html
>> >
>> > is there any difference at all by configuring them either way?
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://camel.465427.n5.nabble.com/transactional-client-vs-transacted-true-on-a-jms-route-tp5722167.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>
>
>
>
> --
> --
> Scott England-Sullivan
> Apache Camel Committer
> Principal Consultant / Sr. Architect | Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: fusesource.com <http://www.fusesource.com> |
> redhat.com<http://www.redhat.com>
> Blog: sully6768.blogspot.com
> Twitter: sully6768



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: transactional client vs transacted=true on a jms route?

2012-11-06 Thread David Karlsen
This makes sense - so with  the scope is the route - not
the endpoint.
Which makes sense for my usecase (which I initially started out with
in my mail) - where the last endpoint in my route is a jms one - and
the first one an jms one - so in this case I should use transacted to
ensure that both endpoints are covered by the same tx.

2012/11/7 Claus Ibsen :
> On Mon, Nov 5, 2012 at 7:36 PM, David J. M. Karlsen
>  wrote:
>> Hi.
>>
>> I have a route where the from endpoint is jms based.
>> The end of the route will be a jms endpoint as well.
>> I also have errorhandling in an onException clause which will put the
>> message on a third jms queue.
>>
>> So in short - jms in - jms out.
>>
>> I wanna protect this messagehandling with a jms transaction handler (all
>> resources use the same connection factory so that messages cannot be lost.
>>
>> I can either configure the route to use  as described in:
>> http://camel.apache.org/transactional-client.html.
>>
>> But I can also just configure the jms endpoints to use transacted=true as
>> described in:
>> http://camel.apache.org/jms.html
>>
>> is there any difference at all by configuring them either way?
>>
>
> Scott and you are both right. Scott highlight the fact that
>  ensures the Camel processing runs inside a TX context.
> Where as without that the TX context is only for the broker (and only
> within the same unit of work from the same JMS session).
>
> So if you only use JMS (from the same broker), then in essence you may
> not need to have  in the route.
> And only if your route starts from JMS.
>
> If you do
>
> from jetty:http
>to jms
>to file
>
> And want the JMS to be transacted, then you would need to use
>  to ensure the route is acting in the same TX context. eg
> to only commit sending the message to the JMS endpoint, if the route
> completed successful.
>
> And therefore you would need to enable TX on the route:
>
> from jetty:http
>transacted
>to jms
>to file
>
>
> Does my rambling make any sense?
>
>
>
>
>
>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/transactional-client-vs-transacted-true-on-a-jms-route-tp5722167.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



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: How to mock a bean in a route?

2012-11-07 Thread David Karlsen
I have a follow up question on this.
I have this route:

 

 





/ledgerres:Document








/ledgerposting:Document









java.lang.Exception

true






this route was easily unit-testable by doing overrides in my setup:
 camelContext.getRouteDefinition( "inboundFromRtsRoute" ).adviceWith(
camelContext, new AdviceWithRouteBuilder()
{
@Override
public void configure()
throws Exception
{
replaceFromWith( mockEndpoint.getDefaultEndpoint() );
weaveById( "inboundFromRtsErrorQueue" ).replace().to(
mockInboundFromRtsErrorQueue );
}
} );

before I added the transacted element.
Is there any easy way for me to skip the transacted node in the route?
I tried weaveById( "transacted" ).remove(); but that removes the node
and all child nodes it seems. I just wanna replace the jms input route
AND the transacted element with my mock endpoint.

Is this possible?

Yes I could use embedded active mq for testing - but that leads to a
lot of excessive config.



2012/11/8 James Carman :
> You can inject mock objects into your route builders very easily.
> Just pick your mock object framework of choice and inject them when
> you create your RouteBuilder.
>
> On Wed, Nov 7, 2012 at 10:37 AM, zzkozak  wrote:
>> Hi,
>>
>>  I have the following route and would like to test it by throwing an
>> exception by the orderRequestCreator bean. How do I do that?
>>
>>
>>
>>  I am using annotated JUnit tests, like this:
>>
>>
>>
>>  Thank you in advance,
>> Marcin
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/How-to-mock-a-bean-in-a-route-tp5722307.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: How to mock a bean in a route?

2012-11-08 Thread David Karlsen
The 1st link gave a 404.
Den 8. nov. 2012 14:25 skrev "James Carman" 
følgende:

> Have you tried just overriding the isMockEndpoints() method:
>
>
> https://github.com/jwcarman/camel-transaction/blob/master/src/test/java/com/carmanconsulting/camel/TestMyRouteBuilder.java
>
> Alternatively, you can just use JMS in your unit test:
>
>
> https://github.com/jwcarman/camel-transaction/blob/master/src/test/java/com/carmanconsulting/camel/AbstractRouteBuilderTest.java
>
>
> On Thu, Nov 8, 2012 at 2:34 AM, David Karlsen 
> wrote:
> > I have a follow up question on this.
> > I have this route:
> >
> >  
> >  >
> >
> uri="jms:queue:{{.online.mq.reservationsReceiveQueue}}?connectionFactory=#rtsConnectionFactory&destinationResolver=#rtsDestinationResolver&asyncStartListener=true&transactionManager=#rtsJmsTransactionManager&transacted=true&lazyCreateTransactionManager=false&disableReplyTo=true"
> > />
> >  > ref="TransactionManagerPolicyRequired" /> 
> >  >
> >
> uri="log:PERF_LOG?level=INFO&groupInterval=6&groupDelay=1&groupActiveOnly=false"
> > />
> >  > loggingLevel="INFO"
> > message="REQUEST: ${body}" />
> > 
> >  > xmlns:ledgerres="fc:evry:com:xsd:fundscheckmaintainavailablebalance">
> >
> > /ledgerres:Document
> >  >
> > uri="validator:META-INF/xsd/fundscheckmaintainavailablebalance.xsd" />
> > 
> >  prettyPrint="true"
> >
> > contextPath="fc.evry.com.xsd.fundscheckmaintainavailablebalance"
> >
> > partClass="fc.evry.com.xsd.fundscheckmaintainavailablebalance.Document"
> > />
> > 
> >  >
> >
> uri="bean:mainLedgerIntegrationServiceImpl?method=processReservationFromMainLedger(
> > ${body} )" />
> > 
> >  > xmlns:ledgerposting="tg:evry:com:xsd:transactiongatetransfertransaction">
> >
> > /ledgerposting:Document
> >  >
> > uri="validator:META-INF/xsd/transactiongatetransfertransaction.xsd" />
> > 
> >  prettyPrint="true"
> >
> > contextPath="tg.evry.com.xsd.transactiongatetransfertransaction"
> >
> > partClass="tg.evry.com.xsd.transactiongatetransfertransaction.Document"
> > />
> > 
> >  >
> >
> uri="bean:mainLedgerIntegrationServiceImpl?method=processPostingFromMainLedger(
> > ${body} )" />
> > 
> > 
> > 
> >
> > java.lang.Exception
> > 
> >
> true
> > 
> >  > uri="log:RTS_MSG_EXCHANGE?showAll=true&level=ERROR" />
> >  >
> uri="jms:queue:{{.online.mq.reservationsReceiveErrorQueue}}?connectionFactory=#rtsConnectionFactory&destinationResolver=#rtsDestinationResolver&transactionManager=#rtsJmsTransactionManager&disableReplyTo=true"
> > />
> > 
> > 
> >
> > this route was easily unit-testable by doing overrides in my setup:
> >  camelContext.getRouteDefinition( "inboundFromRtsRoute" ).adviceWith(
> > camelContext, new AdviceWithRouteBuilder()
> > {
> > @Override
> > public void configure()
> > throws Exception
> > {
> > replaceFromWith( mockEndpoint.getDefaultEndpoint() );
> > weaveById( "inboundFromRtsErrorQueue" ).replace().to(
> > mockInboundFromRtsErrorQueue );
> > }
> > } );
> >
> > before I added the transacted element.
> > Is there any easy way for me to skip the transacted node in the route?
> > I tried weaveById( &qu

Re: Rollback and redeliver JMS message between Websphere and MQ via Camel

2012-11-09 Thread David Karlsen
Configure number of redeliveries to be 0. You might also be interested in
looking into the docs for the transactional error handler which is default
for transacted routes.
Den 9. nov. 2012 10:09 skrev "De Backer Frederik (Belfius)" <
frederik.debac...@belfius.be> følgende:

> Hello,
>
> I have a message driven bean deployed in a Websphere 8.0 server that is
> consuming messages from a Websphere MQ message broker. I would like to
> replace the MDB by a Camel JMS component but I have some issues regarding
> the proper handling of message rollback and XA transactions. The message
> processing does database updates. If an exception occurs during this
> database update (or any other runtime exception occurs) then the database
> updates and the message reception need to be rollbacked (placing the
> message back on the qeue). Up to three redeliveries occur after which the
> WAS message listener puts the message in a backout queue. This setup is
> currently working.
> I tried to mimick this behaviour with Camel but have been unsuccessfull
> until now.
>
> What I see is that Camel itself retries 3 times (without putting back the
> message onto the queue). Only after doing three retries, Camel rollbacks
> the transaction and the message is put back on the queue after which it is
> again redelivered from the queue.
>
> What I would like however is that Camel itself doesn't do a retry but
> immediately rollbacks the message to the queue if an exception occurs. If
> Camel notices that three redeliveries from the queue have been done (this
> can be checked via a custom JMS header property that is set by MQ and that
> indicates the number of redeliveries) then the message has to be placed on
> a backout queue by Camel.
>
> I already looked around but until now I have no idea how I can implement
> this use case.
>
> Below you can find my Camel config file. I am using Camel 2.10.1.
>
> Any help would be greatly appreciated.
>
> kind regards,
>
> Frederik.
>
>
>  class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>  ref="transactionManager" />
>  value="PROPAGATION_REQUIRED" />
> 
>
> http://camel.apache.org/schema/spring";
> id="camelContext">
>  uri="jms:queue:GEPQ.QL.IN_PRINT_CONFIRM.0001?exchangePattern=InOnly" />
> 
>  uri="ref:async.internal.inbound.endpoint" />
> 
> 
> 
>
> java.lang.Throwable
>  redeliveryDelay="5000" maximumRedeliveries="3">
> 
> false
> 
>  uri="jms:queue:GEPQ.QL.IN_PRINT_CONFIRM_BO.0001" />
> 
> 
>
> 
>
> 
>
>  class="org.apache.camel.component.jms.JmsConfiguration">
>  ref="geosConnectionFactory" />
> 
> 
> 
> 
>  ref="transactionManager" />
> 
> 
> 
> 
>
> Frederik De Backer
>
> Belfius
> ITDEV/DCAR/DART
>
> * DT 16 / 37
> * 02/22 25252
> * mailto:frederik.debac...@belfius.be  | www.belfius.be
>
>
>
>
> -
>
> http://www.belfius.be/maildisclaimer.htm
>
>
> -
>


Fwd: Trouble when combining cxf server services and cxf-over-camel transport for a client service

2012-11-09 Thread David Karlsen
Cross-posting to camel as this is camel related.
-- Videresendt melding --
Fra: "David Karlsen" 
Dato: 9. nov. 2012 16:19
Emne: Trouble when combining cxf server services and cxf-over-camel
transport for a client service
Til: 

Hi.

I have a cxf based client service which I use the camel transport for
(to run it async over persistent jms):

  




http://cxf.apache.org/transports/camel





   
RTS







  .


this is inside one spring context file - and all works well.



In addition in the same application I have another context file which
exposes my normal servlet-exposed services which is in another spring
context file cxf-servlet.xml::

   






 






















.


The application boots up fine with *either* of the context files (e.g.
either my single cxf client ws over jms, or either my serverside
services exposed) - but it blows up with this message when both are
loaded:

Can somebody tell me why?

2012-11-09 16:18:16,725 [main][][][][][][][] WARN /cashpool - unavailable
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.apache.cxf.jaxws.EndpointImpl--1528277278': Invocation of init
method failed; nested exception is javax.xml.ws.WebService
Exception: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No bean named
'org.apache.camel.component.cxf.transport.CamelTransportFactory'
is defined
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
~[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
~[spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at
org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.java:146)
~[cxf-rt-transports-http-2.6.2.jar:2.6.2]
at
org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:72)
~[cxf-rt-transports-http-2.6.2.jar:2.6.2]
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:67)
~[cxf-rt-transports-http-2.6.2.jar:2.6.2]
at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:463)
[jetty-servlet-7.6.3.v20120416.jar:7.6.3.v20120416]
at
org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:283)
[jetty-servlet-7.6.3.v20120416.jar:7.6.3.v20120416]
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[jetty-util-7.6.3.v20120416.jar:7.6.3.v20120416]
at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:771)
[jetty-servlet-7.6.3.v20120416.jar:7.6.3.v20120416]
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
[jetty-servlet-7.6.3.v20120416.j

Re: How to mock a bean in a route?

2012-11-10 Thread David Karlsen
That gave a 404 too :)

2012/11/8 James Carman :
> Sorry, I've been tweaking the code:
>
> https://github.com/jwcarman/camel-transaction/blob/master/src/test/java/com/carmanconsulting/camel/TestJdbcRouteBuilder.java
>
> On Thu, Nov 8, 2012 at 3:07 PM, David Karlsen  wrote:
>> The 1st link gave a 404.
>> Den 8. nov. 2012 14:25 skrev "James Carman" 
>> følgende:
>>
>>> Have you tried just overriding the isMockEndpoints() method:
>>>
>>>
>>> https://github.com/jwcarman/camel-transaction/blob/master/src/test/java/com/carmanconsulting/camel/TestMyRouteBuilder.java
>>>
>>> Alternatively, you can just use JMS in your unit test:
>>>
>>>
>>> https://github.com/jwcarman/camel-transaction/blob/master/src/test/java/com/carmanconsulting/camel/AbstractRouteBuilderTest.java
>>>
>>>
>>> On Thu, Nov 8, 2012 at 2:34 AM, David Karlsen 
>>> wrote:
>>> > I have a follow up question on this.
>>> > I have this route:
>>> >
>>> >  
>>> > >> >
>>> >
>>> uri="jms:queue:{{.online.mq.reservationsReceiveQueue}}?connectionFactory=#rtsConnectionFactory&destinationResolver=#rtsDestinationResolver&asyncStartListener=true&transactionManager=#rtsJmsTransactionManager&transacted=true&lazyCreateTransactionManager=false&disableReplyTo=true"
>>> > />
>>> > >> > ref="TransactionManagerPolicyRequired" /> 
>>> > >> >
>>> >
>>> uri="log:PERF_LOG?level=INFO&groupInterval=6&groupDelay=1&groupActiveOnly=false"
>>> > />
>>> > >> > loggingLevel="INFO"
>>> > message="REQUEST: ${body}" />
>>> > 
>>> > >> > xmlns:ledgerres="fc:evry:com:xsd:fundscheckmaintainavailablebalance">
>>> >
>>> > /ledgerres:Document
>>> > >> >
>>> > uri="validator:META-INF/xsd/fundscheckmaintainavailablebalance.xsd" />
>>> > 
>>> > >> prettyPrint="true"
>>> >
>>> > contextPath="fc.evry.com.xsd.fundscheckmaintainavailablebalance"
>>> >
>>> > partClass="fc.evry.com.xsd.fundscheckmaintainavailablebalance.Document"
>>> > />
>>> > 
>>> > >> >
>>> >
>>> uri="bean:mainLedgerIntegrationServiceImpl?method=processReservationFromMainLedger(
>>> > ${body} )" />
>>> > 
>>> > >> > xmlns:ledgerposting="tg:evry:com:xsd:transactiongatetransfertransaction">
>>> >
>>> > /ledgerposting:Document
>>> > >> >
>>> > uri="validator:META-INF/xsd/transactiongatetransfertransaction.xsd" />
>>> > 
>>> > >> prettyPrint="true"
>>> >
>>> > contextPath="tg.evry.com.xsd.transactiongatetransfertransaction"
>>> >
>>> > partClass="tg.evry.com.xsd.transactiongatetransfertransaction.Document"
>>> > />
>>> > 
>>> > >> >
>>> >
>>> uri="bean:mainLedgerIntegrationServiceImpl?method=processPostingFromMainLedger(
>>> > ${body} )" />
>>> > 
>>> > 
>>> > 
>>> >
>>> > java.lang.Exception
>>> > 
>>> >
>>> true
>>> > 
>>> > >> > uri="log:RTS_MSG_EXCHANGE?showAll=true&level=ERROR" />
>>> > >> >
>>> uri="jms:queue:{{.online.mq.reservationsReceiveErrorQueue}}?connectionFactory=#rtsConnectionFactory&a

Re: Trouble when combining cxf server services and cxf-over-camel transport for a client service

2012-11-12 Thread David Karlsen
Eventually I was able to solve this myself (but I have used hours on it).
I removed the explicit config of the transportFactory - and got
another error message from the producers in the camel-route, but when
I explicitly told these producers which camelContext was in use it all
worked in the end.

2012/11/12 Jason Pell :
> I can't help myself, but I would wait about 12 hours more before
> giving up.  Some of the US developers are on weekend time still I
> think.
>
> My experience is that they start responding to posts early morning my
> time (Australian Eastern Standard Time) - its 6pm here, so give it
> another 12 hours :-)
>
> Cheers
> Jason
>
> On Mon, Nov 12, 2012 at 6:51 PM, David Karlsen  wrote:
>> No one?
>>
>> 2012/11/9 David Karlsen :
>>> Hi.
>>>
>>> I have a cxf based client service which I use the camel transport for
>>> (to run it async over persistent jms):
>>>
>>>   >> class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
>>> 
>>> 
>>> 
>>> 
>>> 
>>> http://cxf.apache.org/transports/camel
>>> 
>>> 
>>> 
>>>
>>>>> name="{urn:srv.ledger.fs.edb.com:ws:transaction:v1}LEDSTransactionService_V1PortTypePort.camel-conduit">
>>> RTS
>>> 
>>>
>>>
>>> >>   address="camel://direct:toShadowLedger"
>>>
>>> serviceClass="com.edb.fs.ledger.srv.ws.transaction.v1.LEDSTransactionServiceV1PortType">
>>> 
>>>
>>> >> streamCache="true" trace="true">
>>>   .
>>> 
>>>
>>> this is inside one spring context file - and all works well.
>>>
>>>
>>>
>>> In addition in the same application I have another context file which
>>> exposes my normal servlet-exposed services which is in another spring
>>> context file cxf-servlet.xml::
>>>
>>>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>  
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>
>>> 
>>> 
>>> >> value="${cxf.schemaValidation:true}" />
>>> 
>>> 
>>>
>>> .
>>>
>>>
>>> The application boots up fine with *either* of the context files (e.g.
>>> either my single cxf client ws over jms, or either my serverside
>>> services exposed) - but it blows up with this message when both are
>>> loaded:
>>>
>>> Can somebody tell me why?
>>>
>>> 2012-11-09 16:18:16,725 [main][][][][][][][] WARN /cashpool - unavailable
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name
>>> 'org.apache.cxf.jaxws.EndpointImpl--1528277278': Invocation of init
>>> method failed; nested exception is javax.xml.ws.WebService
>>> Exception: org.springframework.beans.factory.NoSuchBeanDefinitionException:
>>> No bean named 
>>> 'org.apache.camel.component.cxf.transport.CamelTransportFactory'
>>> is defined
>>> at 
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
>>> ~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>>> at 
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
>>> ~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>>> at 
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
>>> ~[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
>>

Re: how to break out of a batch?

2012-12-01 Thread David Karlsen
 AFAIK you can end() the route as shown here:

http://camel.apache.org/predicate.html
Den 30. nov. 2012 01:22 skrev "bung_ho"  følgende:

> Using camel 2.10.
>
> I have a route similar to the following:
>
> 
> 
> 
> 
> 
>
> java.lang.Exception
>
> false
>  uri="bean:utilBean?method=doFailStuff"/>
> 
> 
> 
>
> If multiple files are placed in the directory, then the doneFile GO is
> placed in it, it will process all of the files sequentially, each going
> thru
> the route. Normally this is good.
>
> However, what I want to do is stop the batch if there is an exception with
> one of the files as caught by the .  Right now, it catches
> the exception and executes "doFailStuff" but it proceeds to process the
> remaining files happily, but I don't want that -- I want the entire route
> to
> give up there. Is there a way?
>
> Hope that's clear.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-to-break-out-of-a-batch-tp5723425.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Redirecting a soap request to external webservice

2012-12-04 Thread David Karlsen
I see that this one refers to a wsdl in the configuration.
Would it be feasable to build a generic one that do not need to
configure the wsdl.
I'd like to build a generic soap router and route based on the
contents of a soap header.
I tried using CXF in payload and/or message mode, but it either fails
because it can't get the service descriptions (wsdl needed) - or it
fails me because the CXF interceptor chain tries to parse and figure
out the soap action.

What I'd like to do is to build a camel ws proxy which handles
ws-security using the ws-security support in CXF/WSS4j and then route
it to some backend service which does not utilize wssec - so that I
can keep all the security handling in the camel/cxf proxy.

Any pointers for such a use-case?

2012/12/4 Willem jiang :
> Hi,
>
> Please take a look at this example[1]
> [1]http://camel.apache.org/cxf-proxy-example.html
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
> (English)
>   http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
>
>
>
>
> On Tuesday, December 4, 2012 at 8:36 PM, nmsrinm wrote:
>
>> Hi
>>
>> We need to redirect the SOAP request body received from the client side to
>> the external web service(External server). Can anyone suggest which camel
>> component to be used and is it possible to implement in JAVA DSL?
>> Suggest/Mention some suitable example for the same
>>
>> Here i attached a sample code image which we are implementing.
>>
>> 
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Redirecting-a-soap-request-to-external-webservice-tp5723605.html
>> Sent from the Camel - Users mailing list archive at Nabble.com 
>> (http://Nabble.com).
>
>
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Access a previous message

2012-12-14 Thread David Karlsen
Save the untransformed message in å header ør property
Den 14. des. 2012 16:59 skrev "dmcamp"  følgende:

> Hello All,
>
> I have the following situation:
> In my camel route I'm sending an object, which is then transformed by an
> endpoint, then the transformed object is sent by email by another endpoint,
> and I want to put another endpoint after the last one which deletes the
> original object from a DB.
> How can I achieve this using camel?
>
> Object -> [Transformer - Endpoint 1] -> transformed Object -> [ Email
> Sender
> - Endpoint 2] -> ? -> [Delete Object - Endpoint 3]
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Access-a-previous-message-tp5724107.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: JMS persistence options have no effect

2012-12-17 Thread David Karlsen
Haven't followed the thread very close, but be sure to enable
explicitQos for these flags to kick in
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/core/JmsTemplate.html#isExplicitQosEnabled()
http://camel.apache.org/jms.html


2012/12/17 Christian Müller :
> I tried this too, but it doesn't work neither:
>
> public class CamelActiveMQConsumerPersistentIssueTest extends
> CamelTestSupport {
>
> private BrokerService broker;
>
> @Before
> public void setUp() throws Exception {
> broker = new BrokerService();
> broker.setPersistent(true);
> broker.setUseJmx(false);
> broker.addConnector("tcp://localhost:61616");
> broker.start();
>
> super.setUp();
> }
>
> @After
> public void tearDown() throws Exception {
> super.tearDown();
>
> broker.stop();
> }
>
> @Test
> public void test() throws Exception {
> // 1 = NON_PERSISTENT
> // 2 = PERSISTENT
>
> context.addRoutes(new RouteBuilder() {
> public void configure() throws Exception {
> from("activemq:queue:test?replyToDeliveryPersistent=false")
> .process(new Processor() {
> public void process(Exchange exchange) throws
> Exception {
> assertEquals(Integer.valueOf(1),
> exchange.getIn().getHeader("JMSDeliveryMode", Integer.class));
> exchange.getOut().setBody("Camel");
> }
> });
> }
> });
>
> Exchange ex =
> template.request("activemq:queue:test?deliveryPersistent=false", new
> Processor() {
> public void process(Exchange exchange) throws Exception {
> exchange.getIn().setBody("What's the best integration
> framework?");
> }
> });
>
> assertEquals("Camel", ex.getOut().getBody(String.class));
> assertEquals(Integer.valueOf(1),
> ex.getOut().getHeader("JMSDeliveryMode", Integer.class));
> }
>
> @Override
> protected JndiRegistry createRegistry() throws Exception {
> JndiRegistry registry = super.createRegistry();
> registry.bind("activemq",
> ActiveMQComponent.activeMQComponent("failover:(tcp://localhost:61616)"));
> return registry;
> }
> }
>
> Best,
> Christian
>
> On Sat, Dec 15, 2012 at 10:50 AM, Claus Ibsen  wrote:
>
>> Hi
>>
>> replyToDeliveryPersistent is on the consumer side as I understand it.
>>
>>
>>
>>
>> On Fri, Dec 14, 2012 at 10:27 PM, Christian Müller
>>  wrote:
>> > replyToDeliveryPersistent
>>
>>
>>
>> --
>> 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
>>
>
>
>
> --



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: camel-mail regarding xml configuration

2013-01-10 Thread David Karlsen
Use setHeader or configure properties on the endpoint.
Den 10. jan. 2013 15:38 skrev "tamil13"  følgende:

> How to configure below code into camel-context.xml file?
>
> template = context.createProducerTemplate();
> ProducerTemplate template;
> Map map = new HashMap();
> map.put("To", "davscl...@apache.org");
> map.put("From", "jstrac...@apache.org");
> map.put("Subject", "Camel rocks");
>
> String body = "Hello Claus.\nYes it does.\n\nRegards James.";
> template.sendBodyAndHeaders("smtp://davscl...@apache.org", body, map);
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-mail-regarding-xml-configuration-tp5725280.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Filtering XML exchange body content

2013-01-23 Thread David Karlsen
Maybe try an xslt transform?
Den 23. jan. 2013 23:26 skrev "Martin Stiborský" 
følgende:

> Hello guys,
> is it possible with standard Camel weapons, to filter XML body with XPath
> to contain only selected data?
> I tried various combination of .setBody(), .XPath() and filter().
> I believe the solution needs .setBody(), but I can't find the correct
> solution.
>
> Thanks!
>
> --
> S pozdravem / Best regards
> Martin Stiborský
>
> Jabber: st...@njs.netlab.cz
> Twitter: http://www.twitter.com/stibi
>


Re: Always receive String Message even with jmsMessageType set to Bytes

2013-02-14 Thread David Karlsen
Oh- of course. I overlooked the fact that it was a consuming route. Btw.
Wmq sets a custom IBM prefixed property defining the sending charset.
Ping me directly if you want me to look it up tomorrow at work where I have
the code.
Den 14. feb. 2013 16:44 skrev "Claus Ibsen" 
følgende:

> On Thu, Feb 14, 2013 at 4:22 PM, yxzhao  wrote:
> > We can verify that if the MQ message is sent with MQMessage.format =
> > MQConstants.MQFMT_STRING, then our route will receive text message.
> > Otherwise, it will receive a byte array. Actually, the sending app uses
> the
> > same write bytes method to put the message into the queue. The same
> message
> > can be received as bytes when using MQMessage.readFully method.
> >
> > Also, we need to know the charset that camel/jms uses to convert the
> bytes
> > into string to revert the text message back to bytes since we need to get
> > the original binary values.
> >
>
> It is not Camel doing anything there. Camel uses the JMS Client to get the
> data.
>
> Camel receives a javax.jms.Message which comes in different
> implementations.
> So Camel check if instanceof TextMessage, then its a text. If
> instanceof BytesMessages its a bytes message  etc.
>
> Under the hood its the JMS client, and in your case IBM WebSphere
> being the JMS client.
>
>
> > Any suggestions?
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Always-receive-String-Message-even-with-jmsMessageType-set-to-Bytes-tp5727563p5727605.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: Invoking a static bean method in my camel xml

2013-02-27 Thread David Karlsen
Yes, it's not very well documented.
Here is an example:

in the middle of a route I do:



which will replace the body after the step in the route with the
substring 150 chars into the incoming payload.

2013/2/27 bikehead :
> Is it possible to invoke a static method to a class within my camel.xml
> configuration?
>
> For example I'd like to do something like:
> 
>
> Googleing shows an example of java route builder doing the equivilant of:
> .bean(org.apache.log4j.MDC.class, "put('dpservices.storyKey',
> ${body.urlKey})"
>
> when buiding the route, but I can't find any discussion of doing it in an
> xml file
>
>
> -Brian
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Invoking-a-static-bean-method-in-my-camel-xml-tp5728228.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: cxf response

2013-02-27 Thread David Karlsen
For the jaxb stuff, see:
"Partial marshalling/unmarshalling" on http://camel.apache.org/jaxb.html

2013/2/27 Smith-John :
> I also tried it with generated JAXB classes from my wsdl/xsd and marshalling.
>
> But
> from("cxf:cxfEndpoint?wsdlURL&dataFormat=PAYLOAD").unmarshal(jaxb).process(myProcessor).to("bean:myBean").marshall(jaxb)
> doesn't work.
>
> myBean puts an Object of the generated jaxb classes into the body but I get
> unable to marshal type "example.ExampleResponse" as an element because it is
> missing an @XmlRootElement annotation.
>
> Some advice to fix this would be nice.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/cxf-response-tp5728106p5728236.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: jackson2

2013-03-04 Thread David Karlsen
On it - will come up with a github branch shortly.

2013/2/22 Willem jiang :
> Current I don't think camel support it out of box. But any contributions are 
> welcomed :)
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
> (English)
>   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Friday, February 22, 2013 at 1:04 PM, mmoores wrote:
>
>> I see camel module POMs with jackson2 but i don't see any any public support
>> for the newer com.fasterxml based marshalling. Anyone working on this?
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/jackson2-tp5727987.html
>> Sent from the Camel - Users mailing list archive at Nabble.com 
>> (http://Nabble.com).
>
>
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: jackson2

2013-03-04 Thread David Karlsen
https://github.com/davidkarlsen/camel/tree/jackson2
https://github.com/davidkarlsen/camel/commit/f7d8576409bd3dfa511e029508f65ca1c007d2db


2013/3/4 David Karlsen :
> On it - will come up with a github branch shortly.
>
> 2013/2/22 Willem jiang :
>> Current I don't think camel support it out of box. But any contributions are 
>> welcomed :)
>>
>>
>> --
>> Willem Jiang
>>
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://www.fusesource.com | http://www.redhat.com
>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
>> (English)
>>   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>> Twitter: willemjiang
>> Weibo: 姜宁willem
>>
>>
>>
>>
>>
>> On Friday, February 22, 2013 at 1:04 PM, mmoores wrote:
>>
>>> I see camel module POMs with jackson2 but i don't see any any public support
>>> for the newer com.fasterxml based marshalling. Anyone working on this?
>>>
>>>
>>>
>>> --
>>> View this message in context: 
>>> http://camel.465427.n5.nabble.com/jackson2-tp5727987.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com 
>>> (http://Nabble.com).
>>
>>
>>
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: jackson2

2013-03-04 Thread David Karlsen
There is a change in packagenames and GAV for jackson2 vs jackson1 -
else it's pretty much the same in the cases I've been using it.

2013/3/4 Claus Ibsen :
> On Mon, Mar 4, 2013 at 10:51 AM, David Karlsen  wrote:
>> On it - will come up with a github branch shortly.
>>
>
> Yeah we can migrate to jackson2 in Camel 2.12 / 3.0.
>
> Or maybe even in Camel 2.11 if there is good reasons for doing so.
> And if there is very little migration issues for end users. Or can end
> users easily go from jackson 1.9 to 2.0 ?
>
>
>> 2013/2/22 Willem jiang :
>>> Current I don't think camel support it out of box. But any contributions 
>>> are welcomed :)
>>>
>>>
>>> --
>>> Willem Jiang
>>>
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Web: http://www.fusesource.com | http://www.redhat.com
>>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
>>> (English)
>>>   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>> Twitter: willemjiang
>>> Weibo: 姜宁willem
>>>
>>>
>>>
>>>
>>>
>>> On Friday, February 22, 2013 at 1:04 PM, mmoores wrote:
>>>
>>>> I see camel module POMs with jackson2 but i don't see any any public 
>>>> support
>>>> for the newer com.fasterxml based marshalling. Anyone working on this?
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context: 
>>>> http://camel.465427.n5.nabble.com/jackson2-tp5727987.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com 
>>>> (http://Nabble.com).
>>>
>>>
>>>
>>
>>
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
> --
> 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



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: jackson2

2013-03-05 Thread David Karlsen
Did a pull request:
https://github.com/apache/camel/pull/13

2013/3/4 Claus Ibsen :
> Hi David
>
> Can you attach either a patch file on the JIRA so its easy to patch
> with the general patch command.
> Or do a github pull request or something.
>
>
>
> On Mon, Mar 4, 2013 at 11:15 AM, David Karlsen  wrote:
>> https://github.com/davidkarlsen/camel/tree/jackson2
>> https://github.com/davidkarlsen/camel/commit/f7d8576409bd3dfa511e029508f65ca1c007d2db
>>
>>
>> 2013/3/4 David Karlsen :
>>> On it - will come up with a github branch shortly.
>>>
>>> 2013/2/22 Willem jiang :
>>>> Current I don't think camel support it out of box. But any contributions 
>>>> are welcomed :)
>>>>
>>>>
>>>> --
>>>> Willem Jiang
>>>>
>>>> Red Hat, Inc.
>>>> FuseSource is now part of Red Hat
>>>> Web: http://www.fusesource.com | http://www.redhat.com
>>>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
>>>> (English)
>>>>   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>>> Twitter: willemjiang
>>>> Weibo: 姜宁willem
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Friday, February 22, 2013 at 1:04 PM, mmoores wrote:
>>>>
>>>>> I see camel module POMs with jackson2 but i don't see any any public 
>>>>> support
>>>>> for the newer com.fasterxml based marshalling. Anyone working on this?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: 
>>>>> http://camel.465427.n5.nabble.com/jackson2-tp5727987.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com 
>>>>> (http://Nabble.com).
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> --
>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>
>>
>>
>> --
>> --
>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
> --
> 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



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: dot generation with maven plugin -> classNotFoundException

2011-04-04 Thread David Karlsen
You can probably work around it by adding:
http://repo1.maven.org/maven2/org/slf4j/slf4j-simple/
to the plugins dependency list.

2011/4/4 Michael Dewitte 

> Hi,
>
> I was trying to get some visualisation of my developped route, and so I
> tried the mvn camel:dot target on my route.
> But then I got the following stacktrace. Any clue ? I use Camel 2.7.0 and
> my
> route is configured via Spring XML...
>
> [INFO] Running Camel embedded to load Spring XML files from classpath:
> META-INF/spring/*.xml
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
> details.
> [FATAL ERROR] org.apache.camel.maven.DotMojo#execute() caused a linkage
> error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the
> realms:
> [FATAL ERROR] Plugin realm =
> app0.child-container[org.apache.camel:camel-maven-plugin:2.7.0]
>
>
> [...]
>
> [INFO] Trace
> java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
> at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:230)
> at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
> at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:112)
> at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:275)
> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:248)
> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:261)
> at org.apache.camel.impl.MainSupport.(MainSupport.java:47)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.camel.maven.EmbeddedMojo.runCamel(EmbeddedMojo.java:223)
> at
>
> org.apache.camel.maven.EmbeddedMojo.executeWithoutWrapping(EmbeddedMojo.java:127)
> at org.apache.camel.maven.DotMojo.runCamelEmbedded(DotMojo.java:380)
> at org.apache.camel.maven.DotMojo.execute(DotMojo.java:256)
> at org.apache.camel.maven.DotMojo.execute(DotMojo.java:221)
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Context Monitoring

2011-04-28 Thread David Karlsen
Could this be something:
http://www.infoq.com/news/2008/06/orbitz-opensource-erma ?
Been wondering about the same myself.



2011/4/28 Xavier Coulon 

> Hello,
>
> We are building a data integration solution (kinda ETL) with Camel, and we
> need to monitor the whole processing. Especially, some custom metrics such
> as the total number of items to process, the number of items that were
> already processed with a distinction between success and errors. The first
> metric is already computed by some process (in fact, we use the File
> component headers), the other ones could be known by querying the number of
> completed exchanges.
>
> I know that using JConsole, it is possible to retrieve the managed beans
> attributes, but as we need to store those metrics in a database/log
> files/web console, I was tempted to create a camel route to retrieve the
> counters, with a quartz expression to trigger the metrics retrieval.
> From the documentation, it appears that the JMX Component only supports JMX
> event notifications, which is not my use case.
>
> Until now, I tried to programmatically retrieve the route counters that are
> exposed by JMX, but with no success. Is it possible ? The
>
> exchange.getContext().getRoute("route.monitoring.metrics.phase1").getRouteContext().getManagedInterceptStrategy()
> is of type org.apache.camel.management.InstrumentationInterceptStrategy but
> does not provide a getter on the inner registeredCounters variable
>
> Or should I just use JMX to connect to the local JVM ? Could this be an
> extension to the JMX Component ?
>
>
> Thank you in advance
> Regards,
> --
> Xavier
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Conceptual 'correctness' of using Camel Unit Tests

2011-05-05 Thread David Karlsen
Can they be run in parallel - or can modules be run in parallel - that could
speed things up.

2011/5/5 Christian Schneider 

> I think it is only named wrong. The camel test support is written to
> support integration
> tests not unit tests.
>
> I think it is a very good idea to write real unit tests and integration
> tests. The unit tests are extremly fast and give you a first security. Still
> the integration tests are very important as many errors can only be spotted
> this way.
>
> I think at the moment camel uses a quite pragmatic test concept. Each
> component comes with unit tests and integration tests. As long as the tests
> are fast I think there is no big problem with that.
>
> All in all the problem is though that a whole camel build takes aroung 4
> hours. So we might really be able to do that better. A problem here is
> though the big number of components we have.
>
> Christian
>
>
> Am 05.05.2011 10:56, schrieb Gert Villemos:
>
>  Some would argue that a unit test per definition tests the unit completely
>> standalone. Using JUnit this is easy, especially when combined with
>> Spring,
>> i.e. you can isolate your bean and test each method directly.
>>
>> The Camel Junit on the other hand test the unit as part of a camle route.
>> Even if the route is very simple such as
>>
>> 
>>   
>>   
>>   
>> 
>>
>> Still, It's testing my bean in a context that is more than just using the
>> bean methods.
>>
>> The Camel in Action book 'only' list on benefit of using Camel Junit
>> tests,
>> namely simplification of the unit tests. I would like to hear what the
>> rest
>> of you do / think.
>>
>> - Do you use only Camel Junit tests using routes?
>>
>> - Do  you use 'normal' method oriented JUnit tests for low level tests of
>> individual methods combined with Camel Unit tests for
>> 'component/application' level testing?
>>
>> - Do you see a conceptual problem in unit testing using Camel JUnit?
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Conceptual-correctness-of-using-Camel-Unit-Tests-tp4372286p4372286.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> CXF and Camel Architect
> SOPERA - The Application Integration Division of Talend
> http://www.talend.com
>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Camel CommonJ component for Camel running in jee servers

2011-05-06 Thread David Karlsen
http://repo2.maven.org/maven2/com/bea/wlplatform/commonj-twm/1.1/commonj-twm-1.1.pom(pom
only.).
But available from geronimo:
https://oss.sonatype.org/index.html#nexus-search;quick~commonj

2011/5/6 preben 

>
> This feature
>
> http://camel.465427.n5.nabble.com/Re-RE-Usage-of-server-managed-thread-of-Websphere-td2259287.html
>
> seems really useful when running Camel in jee container like Weblogic or
> WAS
> and would be a nice candidate for a Camel component.
>
> I have started generalizing it to be jee container agnostic using CommonJ
> which is a shared standard between Weblogic and WAS.
>
> What do you think ?
>
> Should I create a ticket ?
>
> /Preben
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-CommonJ-component-for-Camel-running-in-jee-servers-tp4375746p4375746.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: RE : Usage of server managed thread of Websphere

2011-05-06 Thread David Karlsen
Also note that the same scheme exists for spring OOTB where the TaskExecutor
is the abstraction on top of all of these.

2011/5/6 Claus Ibsen 

> On Fri, May 6, 2011 at 4:54 PM, Tarun Ramakrishna 
> wrote:
> > Actually this could have been simply solved if camel core and all
> > camel components delegated their threading needs to a
> > java.util.concurrent.ThreadFactory. Then one could have centralized
> > thread management. Unfortunately even if Camel is well behaved many of
> > its components are not and even associated units like ActiveMQ don't
> > seem to allow you to customize thread creation. But maybe there is a
> > way to do this that I am not aware of.
> >
>
> Came sure does that. There is a SPI for that
>
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ExecutorServiceStrategy.html
>
> It allows to plugin 3rd party providers. So we can provide a CommonJ
> bridge for that out of the box.
>
> But yes for 3rd party components they need to leverage that SPI as
> well. Some of the components do that already.
> But there may be some that uses their own abstraction. For example Jetty
> etc.
>
>
>
>
> --
> Claus Ibsen
> -
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> CamelOne 2011: http://fusesource.com/camelone2011/
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: @XPath for an Integer

2011-05-30 Thread David Karlsen
NaN goes for any Number object.

2011/5/26 Claus Ibsen 

> On Thu, May 26, 2011 at 5:44 PM, boday 
> wrote:
> > agreed...I'll update the patch.  While we are at it, are there any other
> > cases that should be addressed?
> >
>
> I wonder if BigDecimal has any similar NaN stuff?
>
>
> >
> > bvahdat wrote:
> >>
> >> I think that not only Double.NaN should be catched but also Float.NaN.
> >>
> >
> >
> > -
> > Ben O'Day
> > IT Consultant -http://benoday.blogspot.com
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/XPath-for-an-Integer-tp4422095p4429030.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Claus Ibsen
> -
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> CamelOne 2011: http://fusesource.com/camelone2011/
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: What is the meaning of payload in camel?

2011-06-03 Thread David Karlsen
Yes - it is the main data/contents of a message (exchange).
An exchange contains the data plus headers. The headers are usually used to
control sending through an endpoint - but is not part of the data sent.

2011/6/3 ltomuno 

> data?
> content?
> thanks




-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: What is the meaning of payload in camel?

2011-06-03 Thread David Karlsen
Yup - that would be the inbout message payload.

2011/6/3 Hadrian Zbarcea 

> Thanks David,
>
> In code that means Exchange.getIn().getBody();
>
> Hadrian
>
> On Jun 3, 2011, at 2:27 PM, David Karlsen wrote:
>
> > Yes - it is the main data/contents of a message (exchange).
> > An exchange contains the data plus headers. The headers are usually used
> to
> > control sending through an endpoint - but is not part of the data sent.
> >
> > 2011/6/3 ltomuno 
> >
> >> data?
> >> content?
> >> thanks
> >
> >
> >
> >
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>


-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Unable to catch exception from Camel.

2011-06-29 Thread David Karlsen
Here is my sample config:













2011/6/27 Sven Zethelius 

> Sorry, I didn't look at the stack trace close enough.  That is during a
> send, in the camel RedeliveryErrorHandler, so disregard my previous
> statement.  To handle it, you'd need to replace the RedeliveryErrorHandler
> with one that will catch exceptions (e.g. wrap that processor)
>
> -Original Message-
> From: Sven Zethelius
> Sent: Monday, June 27, 2011 8:13 AM
> To: users@camel.apache.org
> Subject: RE: Unable to catch exception from Camel.
>
> Actually you won't be able to catch the exception, since this is caught and
> handled in Spring-JMS AbstractPollingMessageListenerContainer.  It's not
> retry, so much as just constantly polling the destination regardless of
> success or failure.  You may be able to install an ErrorHandler, although I
> haven't found a good way yet since Camel creates the
> MessageListenerContainer for you.
>
> -Original Message-
> From: Ashwin Karpe [mailto:aka...@fusesource.com]
> Sent: Monday, June 27, 2011 7:54 AM
> To: users@camel.apache.org
> Subject: Re: Unable to catch exception from Camel.
>
> Hi,
>
> Looks like your route is not getting established and the exceptionListener
> is not kicking in since the idea is to catch JMS exceptions once the route
> is established/started.
>
> The exception is being thrown while trying to establish the Connection to a
> given queue, prior to the route being started. You will need to catch the
> exception in your main since the exceptionListener is activated upon route
> startup...
>
> Cheers,
>
> Ashwin...
>
> -
> -
> Ashwin Karpe
> Apache Camel Committer & Sr Principal Consultant
> FUSESource (a Progress Software Corporation subsidiary)
> http://fusesource.com
>
> Blog: http://opensourceknowledge.blogspot.com
> CamelOne 2011: http://fusesource.com/camel2011
> -
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Unable-to-catch-exception-from-Camel-tp4528048p4528704.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: slow reply for jms component when url contains replyTo

2011-07-17 Thread David Karlsen
Maybe better to provide a replyto resolver strategyinterface with a few
implementations for vinning cases?
Den 12. juli 2011 07:26 skrev "Claus Ibsen" 
følgende:
>
> On Mon, Jul 11, 2011 at 10:12 PM, Jim Newsham 
wrote:
> >
> > Hi Claus,
> >
> > Thanks for opening the jira issue, and for your comments.  To answer
your
> > questions:
> >
> > 1.  We use fixed reply-to queues which are exclusive to Camel.
> > 2.  We need a fixed reply-to queue to avoid losing reply messages in
case of
> > disconnection (which would happen with temporary queues because they are
> > scoped to the lifetime of the connection).
> >
>
> I think we should add an option to the JMS component so you can
> configure that the replyTo is to be consider as exclusive.
>
> ?replyTo=bar&exclusiveReplyTo=true
>
> Something like this. Anyone got a better idea for a name of the option?
>
> Likewise I have pondered about if we should add an option to have
> convention over configuration? So for example you can configure on the
> jms component, a pattern of the reply to names.
>
> jmsComponent.setExclusiveReplyTo(true);
> jmsComponent.setReplyToPattern("${name}.reply");
>
> So in this example Camel will automatic name the reply to queues, as
> the request queue name + ".reply". So in the example above we can do
>
> from X
> to("jms:queue:bar")
> to Y
>
> So in this example since we configured the component with exclusive
> reply to, and a reply to pattern as well. Then what happens is that
> Camel will use a reply to queue named: bar.reply
>
>
> Of course you can still configure all the options on the endpoint as
> well if you like. And you can override the component settings so in
> case you want a special reply to name you can do:
>
> from X
> to("jms:queue:bar?replyTo=special")
> to Y
>
> Any thoughts?
>
>
> > Regards,
> > Jim
> >
> > On 7/9/2011 5:52 AM, Claus Ibsen wrote:
> >>
> >> Hi Jim
> >>
> >> I have created a ticket and posted some comments about the issue
> >> https://issues.apache.org/jira/browse/CAMEL-4202
> >>
> >> Are you using a fixed reply to queue that is *exclusive* to the Camel
> >> route?
> >> Or is the queue used for other purposes as well?
> >>
> >> Is there a special reason why you want to use a fixed reply to queue?
> >>
> >>
> >>
> >> On Fri, Jul 8, 2011 at 11:14 PM, Jim Newsham
> >>  wrote:
> >>>
> >>> Hi Claus,
> >>>
> >>> I enabled trace logging.  I'm attaching the logs (for both client and
> >>> server; both with and without custom replyTo) as a zip file -- not
sure
> >>> if
> >>> the mailing list will filter it, we'll see.
> >>>
> >>> I see that there are 5 messages in the client log which only appear
when
> >>> a
> >>> custom replyTo is specified:  "Running purge task to see if any
entries
> >>> has
> >>> been timed out", "There are 1 in the timeout map", "did not receive a
> >>> message", etc.  Here's an excerpt from each client log, for one
exchange:
> >>>
> >>>  From log for client without replyTo:
> >>>
> >>> 2011-07-08 10:55:32,354 [main] TRACE
> >>> org.apache.camel.component.jms.JmsProducer - Using inOut jms template
> >>> 2011-07-08 10:55:32,361 [main] DEBUG
> >>> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate -
> >>> Executing
> >>> callback on JMS Session: ActiveMQSession
> >>> {id=ID:rsi-eng-newsham-61473-1310158531968-0:3:1,started=false}
> >>> 2011-07-08 10:55:32,361 [main] TRACE
> >>> org.apache.camel.component.jms.JmsBinding - Using JmsMessageType: Text
> >>> 2011-07-08 10:55:32,362 [main] DEBUG
> >>> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate -
> >>> Sending
> >>> JMS message to: queue://dest with message: ActiveMQTextMessage
{commandId
> >>> =
> >>> 0, responseRequired = false, messageId = null, originalDestination =
> >>> null,
> >>> originalTransactionId = null, producerId = null, destination = null,
> >>> transactionId = null, expiration = 0, timestamp = 0, arrival = 0,
> >>> brokerInTime = 0, brokerOutTime = 0, correlationId =
> >>> ID-rsi-eng-newsham-61472-1310158530715-0-4, replyTo =
> >>> temp-queue://ID:rsi-eng-newsham-61473-1310158531968-0:1:1, persistent
=
> >>> false, type = null, priority = 0, groupID = null, groupSequence = 0,
> >>> targetConsumerId = null, compressed = false, userID = null, content =
> >>> null,
> >>> marshalledProperties = null, dataStructure = null, redeliveryCounter =
0,
> >>> size = 0, properties = null, readOnlyProperties = false, readOnlyBody
=
> >>> false, droppable = false, text = abc}
> >>> 2011-07-08 10:55:32,363 [main] DEBUG
> >>> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate -
Sent
> >>> JMS
> >>> message to: queue://dest with message: ActiveMQTextMessage {commandId
=
> >>> 0,
> >>> responseRequired = false, messageId =
> >>> ID:rsi-eng-newsham-61473-1310158531968-0:3:1:1:1, originalDestination
=
> >>> null, originalTransactionId = null, producerId = null, destination =
> >>> queue://dest, transactionId = null, expiration = 1310158552362,
timestamp
> >>> =
> >>> 1310158532362, arrival = 0, brokerIn

Re: Xquery endpoing with Import Module

2011-08-01 Thread David Karlsen
Could it be useful to have an spring implementation which follow their
Resource abstraction?

2011/7/30 jmandawg 
>
> It looks like you might be able to do something even simpler by calling
> resolveMandatoryResource from within the ModuleURIResolver.  That way it
> will resolve the import in the same way it resolves the endpoint xquery.
>
>
>
> I can take a shot at writing a patch if you guys want.
>
>
>
> From: J- MAN [mailto:jmand...@hotmail.com]
> Sent: Friday, July 29, 2011 11:29 AM
> To: ml-node+4646571-592493739-235...@n5.nabble.com
> Subject: RE: Xquery endpoing with Import Module
>
>
>
> You are right, after doing more research i discovered that saxon allows you
> to define your own import module URI resolver to resolve the import
> statements.
> All you have to do is implement it a ModuleURIResolver and set it with
> staticQueryContext.setModuleURIResolver.
>
> http://www.saxonica.com/documentation9.1/javadoc/net/sf/saxon/query/ModuleUR
> IResolver.html
>
> Can i submit a patch to camel-xquery that will allow urls like this:
>
>                 uri="xquery:com/test/xquery/manual.xq?moduleResolver=classpath"/>
>
> And then imports will be resolved using absolute classpaths (must include
> leading slash):
>
>              import module namespace utils = "myutils" at
> "/com/test/xquery/utils.xq";
>
> This should only affect imports inside xquery files.
>
>
>
>  _
>
> Date: Fri, 29 Jul 2011 04:21:37 -0700
> From: ml-node+4646571-592493739-235...@n5.nabble.com
> To: jmand...@hotmail.com
> Subject: Re: Xquery endpoing with Import Module
>
> camel-saxon will create a input stream to load the xquery file.
> I think it's more like saxon issue, saxon should support to load the
> file from class path.
>
> On 7/29/11 1:04 AM, jmandawg wrote:
>
>
> > Hi all,
> >
> > I'm trying to use an XQuery endpoint which looks like this:
> >
> > 
> >
> > Where "com/test/xquery/manual.xq" is located in my "src/main/resources"
> > folder.
> >
> > When i try to put an import inside the manual.xq file like this:
> >
> > import module namespace utils = "myutils" at "utils.xq";
> >
> > It cannot resolve the file.  If i give it a absolute uri to the file it
> can
> > resolve it.  But the files need to live in my package.
> >
> > I'm running this inside servicemix.
> >
> > Thanks.
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Xquery-endpoing-with-Import-Module-tp46433
> 85p4643385.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Willem
> --
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>          http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
>
>
>  _
>
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Xquery-endpoing-with-Import-Module-tp46433
> 85p4646571.html
>
> To unsubscribe from Xquery endpoing with Import Module, click here
>  e_by_code&node=4643385&code=am1hbmRhd2dAaG90bWFpbC5jb218NDY0MzM4NXwtMTk3Njc2
> ODA4OA==> .
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Xquery-endpoing-with-Import-Module-tp4643385p4648515.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


[Ignore] HTML testus...@camel.apache.org

2011-08-03 Thread David Karlsen
HTML test


--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Insert into CLOB Column in Oracle using JDBC Component

2011-08-06 Thread David Karlsen
What type is the column declared as? AFAIK it should be text.
Den 4. aug. 2011 20:38 skrev "garyssidhu"  følgende:
> Hi , I am newbie to Camel's JDBC Component. I need to insert data into
clob
> column of Oracle 11g Table using Camel's JDBC Component.
>
> My route looks like this
>
> from("direct:requestwriter")
> .to("bean:requestWriterBean")
> .to("jdbc:myDataSourceInWLS10Jndi");
>
> In RequestWriterBean, I am creating insert statement
>
> insert into testCLOBTable values ("1",largexml).
>
> At this point giving an Oracle error that string is large. largexml size
is
>> 4K.
>
> I have tried seaching for an example of using CLOB in JDBC Component but I
> could not find.
>
> I need help urgently!!
>
>
> --
> View this message in context:
http://camel.465427.n5.nabble.com/Insert-into-CLOB-Column-in-Oracle-using-JDBC-Component-tp4667458p4667458.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CAMEL SMTP Mail Componenet Issue on 64 Bit Windows 2008 Server

2011-08-10 Thread David Karlsen
Is the uri smtps or smtp?


Re: slow reply for jms component when url contains replyTo

2011-08-13 Thread David Karlsen
Hi - I would be very interested in this (and willing to test).
We had to back out from using camel for our req/res jms (we now use
jmstemplate directly) - especially because the persistentrelyqueuemanager
(or something like that) seemed to use the same connection - so eventually
the fw closed that connection during hours with little traffic.

Another positive effect of switching to using jmstemplate directly is that
the same thread is handling the response and the request - and we have a
thread scoped state object attached to it.

We are running in a cluster - but because we use correlationid this is not a
problem as you say.

The underlying MOM is WebSphere MQ.

BTW: "vinning" in my rely was supposted to spell "common" - I blame my phone
for that ;-)

2011/8/13 Claus Ibsen 

> Hi Jim, others
>
> I got some code for supporting exclusive replyTo queues. I just want
> to know if you run in a clustered environment.
> As the replyTo queue would be exclusive to each CamelContext (eg each
> node). So if you have 2 nodes running with Camel then each node would
> have to use an unique replyTo queue.
>
> If you run in a single instance of CamelContext then there is of
> course no problem.
>
> Alternative you can always use shared queues in a cluster, as each
> CamelContext (each node) will only pickup intended reply message for
> it (using a JMS selector), which is also the case why its slower. You
> can tweak the performance with the receiveTimeout. That is default 1
> sec. If you set it lower, then it will potential react faster to new
> replies coming back.
>
>
>
> On Fri, Jul 8, 2011 at 3:18 AM, Jim Newsham 
> wrote:
> >
> > I'm using Camel 2.7.1 on top of ActiveMQ 5.5.0.  For some reason, when I
> > specify a custom replyTo destination on the endpoint url, the time it
> takes
> > for the producer to receive a reply increases drastically.  The curious
> > thing is that the time to receive a reply is almost exactly 1 second.
>  When
> > I remove the replyTo from the url, everything's fast again.
> >
> > I created a very simple, stand-alone test to demonstrate what I'm seeing.
> >  There is a server class [4] which runs an embedded instance of ActiveMQ
> and
> > simply replies to messages as they arrive; and a client [3] class which
> > simply sends messages to the server, and prints the elapsed time.  The
> > USE_REPLY_TO symbolic constant in the client determines whether a replyTo
> > value is added to the url or not.
> >
> > The client output when USE_REPLY_TO is false is shown as [1].  The client
> > output when USE_REPLY_TO is true is shown as [2].  The code is pretty
> > trivial.  Am I doing something wrong, or is this a Camel and/or ActiveMQ
> > issue?
> >
> > Thanks!
> > Jim
> >
> >
> > [1] USE_REPLY_TO = false
> >
> > received reply in: 0.476 s
> > received reply in: 0.006 s
> > received reply in: 0.006 s
> > received reply in: 0.006 s
> > received reply in: 0.006 s
> > ...
> >
> >
> > [2] USE_REPLY_TO = true
> >
> > received reply in: 1.524 s
> > received reply in: 1.002 s
> > received reply in: 1.003 s
> > received reply in: 1.003 s
> > received reply in: 1.002 s
> > ...
> >
> >
> > [3] TestReplyToClient.java
> >
> > package test;
> >
> > import org.apache.activemq.ActiveMQConnectionFactory;
> > import org.apache.activemq.camel.component.ActiveMQComponent;
> > import org.apache.camel.CamelContext;
> > import org.apache.camel.ProducerTemplate;
> > import org.apache.camel.impl.DefaultCamelContext;
> >
> > public class TestReplyToClient {
> >
> >  private static final boolean USE_REPLY_TO = false;
> >
> >  public static void main(String... args) throws Exception {
> >// create camel context; configure activemq component for
> > tcp://localhost:7001
> >CamelContext context = new DefaultCamelContext();
> >ActiveMQComponent activemqComponent =
> > ActiveMQComponent.activeMQComponent();
> >activemqComponent.setConnectionFactory(new ActiveMQConnectionFactory(
> >  null, null, "tcp://localhost:7001"));
> >context.addComponent("activemq", activemqComponent);
> >context.start();
> >
> >// define url to send requests to
> >String sendUrl = "activemq:queue:dest";
> >if (USE_REPLY_TO) {
> >  sendUrl += "?replyTo=replyQueue";
> >}
> >System.err.println("sending to url: " + sendUrl);
> >
> >// repeatedly send requests; measure elapsed time
> >ProducerTemplate template = context.createProducerTemplate();
> >while (true) {
> >  long startNanos = System.nanoTime();
> >  template.requestBody(sendUrl, "abc");
> >  long elapsedNanos = System.nanoTime() - startNanos;
> >  System.err.println(String.format("received reply in: %.3f s",
> > elapsedNanos / 10.0));
> >}
> >  }
> >
> > }
> >
> >
> > [4] TestReplyToServer.java
> >
> > package test;
> >
> > import org.apache.activemq.broker.BrokerService;
> > import org.apache.activemq.camel.component.ActiveMQComponent;
> > import org.apache.camel.CamelContext;
> > import org.apache.camel.Exch

Re: Sending Nagios Passive Checks from Spring - HowTo ?

2011-08-13 Thread David Karlsen
Yes, while attempting to connect it timed out.
You can debug by issing "telnet hostname port" or "telnet host:port" on the
command line.

2011/8/13 Tereza Nedelescu 

> Thank you, that started things going. Now I have another error:
>
> Exhausted after delivery attempt: 1 caught:
> java.net.SocketTimeoutException:
> connect timed out
> java.net.SocketTimeoutException: connect timed out
>at java.net.PlainSocketImpl.socketConnect(Native Method)
>at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>at java.net.Socket.connect(Socket.java:529)
>at
>
> com.googlecode.jsendnsca.core.NagiosPassiveCheckSender.send(NagiosPassiveCheckSender.java:69)
>at
>
> org.apache.camel.component.nagios.NagiosProducer.process(NagiosProducer.java:60)
>
> I'm assuming this means I cannot connect to Nagios, so it's an external
> problem. Is this the case ?
>
> Thanks,
> Tereza
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4696985.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


  1   2   >