Re: Programmatic CXF Endpoint

2015-08-03 Thread sloanecourt
I found that the 3 lines of code following TLS Parameters resolved the
SSL/TLS issue.

  @Override
  public void configureClient(Client client) {

// Policy
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy policy = conduit.getClient();
if (policy == null) {
  policy = new HTTPClientPolicy();
  conduit.setClient(policy);
}

// Policy
policy.setConnectionTimeout(1L);
policy.setReceiveTimeout(1L);

// TLS Parameters
TLSClientParameters tlsClientParameters = new TLSClientParameters();
   
tlsClientParameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
conduit.setTlsClientParameters(tlsClientParameters);

  }
}

  }

Regards
Anthony Dodd
Fundtech Financial Messaging




--
View this message in context: 
http://camel.465427.n5.nabble.com/Programmatic-CXF-Endpoint-tp5756368p5770254.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Restlet

2015-08-03 Thread anish.somadevan
But i just noticed that when i have HTTPS and mention :443 as the port
number, i get the header missing error again. So basically the header is not
being set for some reason. But i don't understand why



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Restlet-tp5767988p5770261.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Bus configuration not working for rsClient

2015-08-03 Thread Aniruddha
HI Guys,

we are using cxf rsClient to call a third party REST webservice. The bean is
configured as follows:

cxf:rsClient id=quot;rsActivationquot;
address=lt;some url
bus=#sdp-rest-client
cxf:headers
entry key=Accept value=application/xml /
/cxf:headers
/cxf:rsClient

and the bean is used in the route as:

inOut uri=cxfrs:bean:rsActivation /

What we noticed is that the bus configuration specified in the bean
definition (bus=#sdp-rest-client) is ignored by the framework. But if we
specify the bus config as a property of the rsClient bean then it works:

cxf:properties
   entry key=bus value-ref=sdp-rest-client /
/cxf:properties

Can you please let me know how to get the bus configuration working by
specifying in the bean definition instead of property?

Thanks,
Ani



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bus-configuration-not-working-for-rsClient-tp5770267.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel CXF Soap Message not decorated with 'mustUnderstand=true'

2015-08-03 Thread peter.berkman
figured it out.  I had the out interceptor set to Phase.PRE_PROTOCOL.  Once I
changed it to Phase.WRITE, everything worked as expected.

Some standard interceptor after mine was setting it to false!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-CXF-Soap-Message-not-decorated-with-mustUnderstand-true-tp5770258p5770262.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Some Stupid Questions

2015-08-03 Thread Raul Kripalani
On 2 Aug 2015 13:05, Felix Thomas felix.tho...@gmail.com wrote:

  2) Threading :- If I have declared a Bean as above and if I use it in a
 SPLIT in Parallel processing mode using a Thread profile. Will Camel also
 create a Pool of the bean and pass it for each thread. i.e. if my Pool
size
 is 5 will  camel create 5 instance of the bean class and use it in the
 processing automatically.  I want to know if it will be thread safe for
 each bean object.

Camel will not build the bean, but it will request it to the registry. So
it's up to the registry to return a new instance or a singleton. In Spring,
you can configure this with the 'scope' attribute.

I suggest you give it a spin with printlns so you can understand when the
new instances are created.

By default, all registries (Spring, Blueprint, Simple Java) return
singletons.


 3) Database component :-  If i am getting billions of data from a DB using
 a timer component consumer is there any feature that I can mark some
column
 with some flag stating it has been processed .

 I saw in the SQL Component there are some option like consumer.onConsume
 etc. but is there something similar in JDBC component .  Other approach is
 to move some records to a temporary table and use that but still some flag
 has to be done on the Original table which is being updated every moment.

I suggest you add a WHERE condition to filter out records that do not have
this flag, and use an onCompletion with onCompleteOnly, in sync mode and
BeforeConsumer, in order to set the flag on the record(s) before the route
is done processing.


Re: Programmatic CXF Endpoint

2015-08-03 Thread Willem Jiang
Yeah, there is a gap between the Camel SSL setting and CXF SSL setting, that is 
why we introduced the CxfEndpointConfigurer to fill this gap. Current Camel SSL 
Support is per the camel context , we may need to introduce a option into 
CXFEndpoint to let it know how to create the SSLContext from Camel SSL setting.

I just fill a JIRA[1] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-9046

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On August 2, 2015 at 4:46:43 PM, sloanecourt (anthony.d...@fundtech-fm.com) 
wrote:
 Thanks very much for implementing this change, very simple to use.
  
 The only problem I have at the moment is configuring the SSL support in the
 Client. Coding is not the main issue, as this is discussed on several
 threads, what I'm looking for is a way of utilising the mechanism Camel uses
 internally, when not using CxfEndPointConfigurer to establish the SSL
 configuration.
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Programmatic-CXF-Endpoint-tp5756368p5770215.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Property aded to my body is removed when endpoint is a queue

2015-08-03 Thread masalinas
Ok thanks, I'll pass my variables using this way.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Property-aded-to-my-body-is-removed-when-endpoint-is-a-queue-tp5770003p5770237.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Asynch Bi-Directional Persistent Socket

2015-08-03 Thread LOPEZ, MAURICIO
Hello, I have an IBM-Streams backend that communicates natively using a custom 
socket passing tuples of data.

This is currently setup as a bi-directional persistent asynchronous TCP-IP 
socket.   We are seeing that our camel instance is initiating a close on the 
socket. We need this socket to remain open.

Thanks in advance for your help,
Mauricio

Here is our route...
route trace=true xmlns=http://camel.apache.org/schema/spring;
errorHandlerRef=defaultErrorHandler

from uri=direct:sourceRoute /
setHeader headerName=NETTY_CLOSE_CHANNEL_WHEN_COMPLETE
groovy
   return Boolean.FALSE;
/groovy
/setHeader
   loadBalance
   roundRobin/
   inOut 
uri=netty:tcp://{{streamsIP1}}?textline=truekeepAlive=truedisconnectOnNoReply=falseoption.child.keepAlive=truesync=truedecoderMaxLineLength={{restMaxLineLength}}autoAppendDelimiter=falsedisconnect={{disconnect}}producerPoolMaxActive={{producerPoolMaxActive}}producerPoolMinEvictableIdle={{producerPoolMinEvictableIdle}}
 /
   inOut 
uri=netty:tcp://{{streamsIP2}}?textline=truekeepAlive=truedisconnectOnNoReply=falseoption.child.keepAlive=truesync=truedecoderMaxLineLength={{restMaxLineLength}}autoAppendDelimiter=falsedisconnect={{disconnect}}producerPoolMaxActive={{producerPoolMaxActive}}producerPoolMinEvictableIdle={{producerPoolMinEvictableIdle}}
 /
   inOut 
uri=netty:tcp://{{streamsIP3}}?textline=truekeepAlive=truedisconnectOnNoReply=falseoption.child.keepAlive=truesync=truedecoderMaxLineLength={{restMaxLineLength}}autoAppendDelimiter=falsedisconnect={{disconnect}}producerPoolMaxActive={{producerPoolMaxActive}}producerPoolMinEvictableIdle={{producerPoolMinEvictableIdle}}
 /
   /loadBalance
   to uri=bean:source?method=process /
   to uri=bean:cache?method=resume /

onException

exceptioncom.att.csi.tdice.recommendation.validation.CustomBuilderException/exception
exceptionjava.lang.Exception/exception
handled
constanttrue/constant
/handled
to uri=bean:exceptionCaught?method=process /
to uri=bean:cache?method=resume /

/onException
/route



Mauricio Lopez
  [http://presence.q.att.com/presence/ml5174.gif]  :  ml5174qto://talk/ml5174





Re: Camel Restlet

2015-08-03 Thread anish.somadevan
Is there a difference in way it works in browser? Coz i see that when i
access the REST URL in browser i don't get any SSL errors coz of the CA
trusted certs the URL has. Do you reckon having .jks file in classpath is
the only way to access URL over HTTPS connection?

Thanks,
Anish



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Restlet-tp5767988p5770256.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Message not received while testing.

2015-08-03 Thread Marc Ende
Hi there,

while trying to get testing with camel and spring work. I've got some
trouble with this testcase.

The route starts with activemq:queue:a.data when the header is correctly
set it will be delivered to bean A or bean B (if completely wrong to bean
C).
But when I use the producer the endpoint mock:activemq:/queue:a.data is
called and the message is also successfully delivered to the endpoint of
mock:bean://processorA. (There is also an output which shows the successful
delivery. BUT the counter in MockEndpoint (of mock:bean://processorA) isn't
incremented. So the test fails.

Is there anything I'm missing?

Thanks for your help.

Marc


If I run this test this is my output:

2015-08-03 13:34:42,580 DEBUG [main]
o.a.camel.component.jms.JmsConfiguration [JmsConfiguration.java:341]
Sending JMS message to: queue://a.data 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 = null,
replyTo = null, persistent = true, 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 = {data_origin=A,
breadcrumbId=ID-Marc-Ende-local-54290-1438601681543-0-1},
readOnlyProperties = false, readOnlyBody = false, droppable = false,
jmsXGroupFirstForConsumer = false, text = messagetest/message}
activemq.broker=localhost
2015-08-03 13:34:42,589 DEBUG [Camel (camel-1) thread #0 -
JmsConsumer[a.data]] o.a.c.c.j.DefaultJmsMessageListenerContainer
[AbstractPollingMessageListenerContainer.java:296] Received message of type
[class org.apache.activemq.command.ActiveMQTextMessage] from consumer
[PooledMessageConsumer { ActiveMQMessageConsumer {
value=ID:Marc-Ende.local-54293-1438601682328-3:1:1:1, started=true } }] of
session [PooledSession { ActiveMQSession
{id=ID:Marc-Ende.local-54293-1438601682328-3:1:1,started=true} }]
activemq.broker=localhost
2015-08-03 13:34:42,592 INFO [main] ProcessingRouteTest
[ProcessingRouteTest.java:61] assertion:0 activemq.broker=localhost
2015-08-03 13:34:42,591 DEBUG [Camel (camel-1) thread #0 -
JmsConsumer[a.data]] o.a.c.c.jms.EndpointMessageListener
[EndpointMessageListener.java:68] Endpoint[activemq://queue:a.data]
consumer received JMS message: ActiveMQTextMessage {commandId = 7,
responseRequired = true, messageId =
ID:Marc-Ende.local-54293-1438601682328-3:1:2:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:Marc-Ende.local-54293-1438601682328-3:1:2:1, destination =
queue://a.data, transactionId = null, expiration = 0, timestamp =
1438601682584, arrival = 0, brokerInTime = 1438601682585, brokerOutTime =
1438601682588, correlationId = null, replyTo = null, persistent = true,
type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
size = 1070, properties = {data_origin=A,
breadcrumbId=ID-Marc-Ende-local-54290-1438601681543-0-1},
readOnlyProperties = true, readOnlyBody = true, droppable = false,
jmsXGroupFirstForConsumer = false, text = messagetest/message}
activemq.broker=localhost
2015-08-03 13:34:42,592 INFO [main] o.a.camel.component.mock.MockEndpoint
[MockEndpoint.java:377] Asserting:
Endpoint[mock://bean://processorA?method=processContent] is satisfied
activemq.broker=localhost
2015-08-03 13:34:42,593 DEBUG [main] o.a.camel.component.mock.MockEndpoint
[MockEndpoint.java:1370] Waiting on the latch for: 3000 millis
activemq.broker=localhost
2015-08-03 13:34:42,603 DEBUG [Camel (camel-1) thread #0 -
JmsConsumer[a.data]] org.apache.camel.processor.SendProcessor
[SendProcessor.java:125] 
Endpoint[bean://processorA?method=processContent]
Exchange[JmsMessage[JmsMessageID:
ID:Marc-Ende.local-54293-1438601682328-3:1:2:1:1]] activemq.broker=localhost
2015-08-03 13:34:42,612 DEBUG [Camel (camel-1) thread #0 -
JmsConsumer[a.data]] ProcessorAImpl [ProcessorAImpl.java:20] A-Received
Message: messagetest/message (Exchange[JmsMessage[JmsMessageID:
ID:Marc-Ende.local-54293-1438601682328-3:1:2:1:1]])
activemq.broker=localhost
2015-08-03 13:34:45,598 DEBUG [main] o.a.camel.component.mock.MockEndpoint
[MockEndpoint.java:1357] Took 3005 millis to complete latch
activemq.broker=localhost
2015-08-03 13:34:45,599 INFO [main] ProcessingRouteTest
[StopWatchTestExecutionListener.java:53]

activemq.broker=localhost
2015-08-03 13:34:45,599 INFO [main] ProcessingRouteTest
[StopWatchTestExecutionListener.java:54] Testing done:
testRouteToA(ProcessingRouteTest) activemq.broker=localhost
2015-08-03 13:34:45,600 INFO [main] 

Re: Rest DSL, HTTP_RESPONSE_CODE and bindings

2015-08-03 Thread Ed Welch
Thanks Andy,

This worked great!

On Fri, 31 Jul 2015 00:12:30 -0500, Andrew Block andy.bl...@gmail.com wrote:

 Ed,
 
 You can set the skipBindingModeOnErrorCode option to false to leverage the 
 existing binding configuration.
 
 - Andy
 
 -- 
 Andrew Block
 
 
 On July 30, 2015 at 4:21:00 PM, Ed Welch (e...@edjusted.com) wrote:
 
 I'm trying to send a 400 response back to the client, however, I want to send 
 the same body type as registered with outType.  
 
 The docs around customer error messages say:  
 
 In the UserErrorService bean we build our custom error message, and set the 
 HTTP error code to 400. This is important, as that tells rest-dsl that this 
 is a custom error message, and the message should not use the output pojo 
 binding (eg would otherwise bind to CountryPojo).  
 
 So when I set:  
 
 exchange.getIn().setHeader(Exchange.HTTP_RESPONSE_CODE, 400);  
 
 That tells the rest-dsl to not use the output pojo binding.  
 
 Except that's exactly what I want it to do.  
 
 Is there a way to return a 400+ response code AND keep the rest binding mode 
 behavior as if it were a 200?  
 
 Thanks!  
 Ed




Camel CXF Soap Message not decorated with 'mustUnderstand=true'

2015-08-03 Thread peter.berkman
I have a Camel route that is a CXF Soap server (listener).

I need the Action ../ entry in the response to include the
mustUnderstand=true decoration.

I've set everything I know to enable this and dumping the headers before the
message is returned shows that it is in fact set to true:

20150803 13:16:59.137 [TRACE] qtp15869638-258 |
374:com.nextgate.ms.components.bundles.ngms-processor-library |
com.nextgate.ms.component.processor.soap.interceptor.MustUnderstandResponseInterceptor
| Header (soap): [http://www.w3.org/2005/08/addressing] [Action] []
mustUnderstand: [true]


however, when the response is returned to the client, it is NOT set:

Action
xmlns=http://www.w3.org/2005/08/addressing;urn:hl7-org:v3:PRPA_IN201306UV02/Action

any ideas why this would not be working?

help please :D




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-CXF-Soap-Message-not-decorated-with-mustUnderstand-true-tp5770258.html
Sent from the Camel - Users mailing list archive at Nabble.com.