R: Issue accessing cert file in camel

2020-02-26 Thread Andrea Cosentino
Maybe report the version

Inviato da Yahoo Mail su Android 
 
  Il mer, 26 feb, 2020 alle 21:58, Kaithakottil, Manoj 
(GST) ha scritto:
We are facing the following error from camel trying to access the cacerts file 
we have defined in our camel-routes.xml file.
 
  
 
Section of code in camel-routes.xml:
 
  
 

 
 
 
   
 
 
 
   
 
  
 
Error receiving from camel container:
 
  
 
  
 
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
endpoint: 
https4://boomi.gstoyota.com/ws/simple/executeReceivekafkamsg?bridgeEndpoint=true=%23sslContextParameters=false
 due to: Could not open /etc/pki/ca-trust/extracted/java/cacerts as a file, 
class path resource, or URL.
 
    at 
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:758)
 
    at 
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80)
 
    at 
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:219)
 
    at 
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:115)
 
    at 
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:121)
 
    at 
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62)
 
    at 
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56)
 
    at 
org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:562)
 
    at 
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:523)
 
    at 
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:239)
 
    at 
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1300)
 
    ... 35 more
 
Caused by: java.io.IOException: Could not open 
/etc/pki/ca-trust/extracted/java/cacerts as a file, class path resource, or URL.
 
    at 
org.apache.camel.util.jsse.JsseParameters.resolveResource(JsseParameters.java:188)
 
    at 
org.apache.camel.util.jsse.KeyStoreParameters.createKeyStore(KeyStoreParameters.java:174)
 
    at 
org.apache.camel.util.jsse.KeyManagersParameters.createKeyManagers(KeyManagersParameters.java:108)
 
    at 
org.apache.camel.util.jsse.SSLContextParameters.createSSLContext(SSLContextParameters.java:296)
 
    at 
org.apache.camel.component.http4.HttpComponent.createConnectionRegistry(HttpComponent.java:373)
 
    at 
org.apache.camel.component.http4.HttpComponent.createConnectionManager(HttpComponent.java:343)
 
    at 
org.apache.camel.component.http4.HttpComponent.createEndpoint(HttpComponent.java:273)
 
    at 
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:126)
 
    at 
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:711)
 
    ... 45 more
 
2020-02-26 20:55:19 INFO  MainSupport$HangupInterceptor:87 - Received hang up - 
stopping the main instance.
 
  
 
  
 
Please let us know if this issue has been seen by anyone else and what the 
resolution was.
 
  
 
Thanks,
 
  
 
Manoj Kaithakottil
 
Platform Architect
 
  
 

 
  
 
1375 Enclave Parkway
 
Houston, TX  77077
 
Work:  713.580.7124
 
Cell:281-948-4138
 
  
   


Re: Stopping a Route when no more messages meet JMS selector

2020-02-26 Thread nomit babraa
Hi
Thanks for all the input.
Decided to use Jan's excellent suggestion, and non-IDE tested code
that worked straight off! :)
Many thanks indeed,
I'm slowly learning how powerful Camel is!
Cheers


On Mon, 24 Feb 2020 at 23:02, Jan Bednář  wrote:
>
> Hi,
> another idea can be pollEnrich. Content Enricher produces empty message,
> when timeout occures (in this case 1s). You can react on this by
> stopping route.
>
> from("timer:drain_messages?period=1")
>  .pollEnrich("jms:queue?selector=whatever", 1000)
>  .choice()
>  .when(body().isNull())
> .to("controlbus:route?routeId=current=stop=true")
>  .otherwise()
>  .to("log:do_actual_processing");
>
> I have wrote this directly to email without my IDE, but I think this
> should work.
>
> Dne 24.2.2020 v 14:32 nomit babraa napsal(a):
> > Hi
> >
> > Looks interesting but can't see a way to set that property from any 
> > examples.
> >
> > I did find www reference to
> >
> > camel.springboot.duration-max-idle-seconds=
> >
> > but I was hoping for something I could set with JMS uri options or java DSL.
> >
> > Cheers
> >
> >
> >
> > On Mon, 24 Feb 2020 at 08:19, Alex Dettinger  wrote:
> >> Not sure about the exact implementation, but I would investigate the camel
> >> code around MainSupport.durationIdle.
> >>
> >> On Sun, Feb 23, 2020 at 11:22 PM nomit babraa 
> >> wrote:
> >>
> >>> Hi
> >>>
> >>> I was wondering if there is any way to do the following:
> >>>
> >>> - A route starts up.
> >>> - It consumes certain messages from an AMQ queue using a selector.
> >>> - Once all current messages are consumed the route is
> >>> stopped/suspended (Control Bus, CamelContext.stop(),
> >>> THROTTLINGINFLIGHTROUTEPOLICY, etc)
> >>>
> >>> I think I can use schedulers and throttling to almost achieve what I
> >>> want but I explicitly want the route to be stopped when all current
> >>> messages that are found by the selector are consumed.
> >>>
> >>> I'm not sure how to get that metric and act upon it?
> >>>
> >>> Many thanks for any advice...
> >>>
> >>> n
> >>>
>


Issue accessing cert file in camel

2020-02-26 Thread Kaithakottil, Manoj (GST)
We are facing the following error from camel trying to access the cacerts file 
we have defined in our camel-routes.xml file.

Section of code in camel-routes.xml:


 
   
 
   

Error receiving from camel container:


Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
endpoint: 
https4://boomi.gstoyota.com/ws/simple/executeReceivekafkamsg?bridgeEndpoint=true=%23sslContextParameters=false
 due to: Could not open /etc/pki/ca-trust/extracted/java/cacerts as a file, 
class path resource, or URL.
at 
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:758)
at 
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80)
at 
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:219)
at 
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:115)
at 
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:121)
at 
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62)
at 
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56)
at 
org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:562)
at 
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:523)
at 
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:239)
at 
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1300)
... 35 more
Caused by: java.io.IOException: Could not open 
/etc/pki/ca-trust/extracted/java/cacerts as a file, class path resource, or URL.
at 
org.apache.camel.util.jsse.JsseParameters.resolveResource(JsseParameters.java:188)
at 
org.apache.camel.util.jsse.KeyStoreParameters.createKeyStore(KeyStoreParameters.java:174)
at 
org.apache.camel.util.jsse.KeyManagersParameters.createKeyManagers(KeyManagersParameters.java:108)
at 
org.apache.camel.util.jsse.SSLContextParameters.createSSLContext(SSLContextParameters.java:296)
at 
org.apache.camel.component.http4.HttpComponent.createConnectionRegistry(HttpComponent.java:373)
at 
org.apache.camel.component.http4.HttpComponent.createConnectionManager(HttpComponent.java:343)
at 
org.apache.camel.component.http4.HttpComponent.createEndpoint(HttpComponent.java:273)
at 
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:126)
at 
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:711)
... 45 more
2020-02-26 20:55:19 INFO  MainSupport$HangupInterceptor:87 - Received hang up - 
stopping the main instance.


Please let us know if this issue has been seen by anyone else and what the 
resolution was.

Thanks,

Manoj Kaithakottil
Platform Architect

[cid:image001.png@01D5A153.8DA58490]

1375 Enclave Parkway
Houston, TX  77077
Work:  713.580.7124
Cell:281-948-4138



special delay

2020-02-26 Thread Joseph M'BIMBI-BENE
Hello, i would like to know if that is possible in Camel to consumer with
an initial delay but not have a delay after every message. If that is not
clear, here is a picture of what is would like:

[image: image.png]

Thank you


Re: SJMS2 vs JMS components for transfer messages from and to ActiveMQ Artemis

2020-02-26 Thread Mikhail Lukyanov
I updated Camel to the new version 2.25.0 and ran the tests described. The
speeds did not change
For SJMS2 ~8 000 msg/s
[image: image.png]
For common JMS ~20 000 msg/s
[image: image.png]



ср, 26 февр. 2020 г. в 16:05, Andrea Cosentino :

> 2.20.2 is really old. You can try with newer versions.
>
> Il giorno mer 26 feb 2020 alle ore 13:59 Mikhail Lukyanov <
> lukyanov...@gmail.com> ha scritto:
>
> > I am trying to find the fastest way to transfer messages from one
> ActiveMQ
> > queue to another Artemis. And I thought that the SJMS2 component would be
> > faster than traditional JMS, but routing with JMS is 2.5 times faster (20
> > 000 vs 8000 msg/s). I use Camel version 2.20.2 and Artemis version
> 2.11.0.
> >
> > Route with JMS
> >
> > import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
> > import org.apache.camel.builder.RouteBuilder;
> > import org.apache.camel.impl.JndiRegistry;
> > import org.apache.camel.test.junit4.CamelTestSupport;
> > import org.junit.Test;
> > import org.messaginghub.pooled.jms.JmsPoolConnectionFactory;
> >
> > import javax.jms.ConnectionFactory;
> > import java.util.concurrent.TimeUnit;
> >
> > public class JMSTransferTest extends CamelTestSupport {
> > @Test
> > public void testArtemis() throws Exception {
> > TimeUnit.SECONDS.sleep(100);
> > }
> >
> > @Override
> > protected RouteBuilder createRouteBuilder() throws Exception {
> > return new RouteBuilder() {
> > public void configure() {
> >
> > from("jms://TEST.IN?connectionFactory=#artemisCF=200
> ")
> >
>  .to("jms://TEST.OUT?connectionFactory=#artemisCF");
> > }
> > };
> > }
> >
> > @Override
> > protected JndiRegistry createRegistry() throws Exception {
> > JndiRegistry registry = super.createRegistry();
> >
> > final ConnectionFactory connFactory = new
> > ActiveMQConnectionFactory("tcp://localhost:61622");
> > final ConnectionFactory connFactoryDeadLeatter = new
> > ActiveMQConnectionFactory("tcp://localhost:61622");
> > JmsPoolConnectionFactory pooledConnectionFactory = new
> > JmsPoolConnectionFactory();
> >
> > pooledConnectionFactory.setConnectionFactory(connFactory);
> > pooledConnectionFactory.setMaxConnections(20);
> > pooledConnectionFactory.setMaxSessionsPerConnection(100);
> > registry.bind("artemisCF", pooledConnectionFactory);
> > registry.bind("deadLetterCF", connFactoryDeadLeatter);
> > return registry;
> > }
> > }
> >
> > Route with SJMS2, other settings as in the code above
> >
> >  @Override
> > protected RouteBuilder createRouteBuilder() throws Exception {
> > return new RouteBuilder() {
> > public void configure() {
> >
> >
> >
> from("sjms2://SJMS.CONSUMER.TEST?connectionFactory=#artemisCF=200=true")
> >
> > .to("sjms2://OUT.SJMS.CONSUMER.TEST?connectionFactory=#artemisCF");
> > }
> > };
> > }
> >
> > How can I use the SJMS2 component to get the same speeds as JMS
> component?
> >
>


-- 
*С наилучшими пожеланиями, Лукьянов Михаил*
*Моб: **+7-909-69-71-547​*


Re: SJMS2 vs JMS components for transfer messages from and to ActiveMQ Artemis

2020-02-26 Thread Andrea Cosentino
2.20.2 is really old. You can try with newer versions.

Il giorno mer 26 feb 2020 alle ore 13:59 Mikhail Lukyanov <
lukyanov...@gmail.com> ha scritto:

> I am trying to find the fastest way to transfer messages from one ActiveMQ
> queue to another Artemis. And I thought that the SJMS2 component would be
> faster than traditional JMS, but routing with JMS is 2.5 times faster (20
> 000 vs 8000 msg/s). I use Camel version 2.20.2 and Artemis version 2.11.0.
>
> Route with JMS
>
> import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.impl.JndiRegistry;
> import org.apache.camel.test.junit4.CamelTestSupport;
> import org.junit.Test;
> import org.messaginghub.pooled.jms.JmsPoolConnectionFactory;
>
> import javax.jms.ConnectionFactory;
> import java.util.concurrent.TimeUnit;
>
> public class JMSTransferTest extends CamelTestSupport {
> @Test
> public void testArtemis() throws Exception {
> TimeUnit.SECONDS.sleep(100);
> }
>
> @Override
> protected RouteBuilder createRouteBuilder() throws Exception {
> return new RouteBuilder() {
> public void configure() {
>
> from("jms://TEST.IN?connectionFactory=#artemisCF=200")
> .to("jms://TEST.OUT?connectionFactory=#artemisCF");
> }
> };
> }
>
> @Override
> protected JndiRegistry createRegistry() throws Exception {
> JndiRegistry registry = super.createRegistry();
>
> final ConnectionFactory connFactory = new
> ActiveMQConnectionFactory("tcp://localhost:61622");
> final ConnectionFactory connFactoryDeadLeatter = new
> ActiveMQConnectionFactory("tcp://localhost:61622");
> JmsPoolConnectionFactory pooledConnectionFactory = new
> JmsPoolConnectionFactory();
>
> pooledConnectionFactory.setConnectionFactory(connFactory);
> pooledConnectionFactory.setMaxConnections(20);
> pooledConnectionFactory.setMaxSessionsPerConnection(100);
> registry.bind("artemisCF", pooledConnectionFactory);
> registry.bind("deadLetterCF", connFactoryDeadLeatter);
> return registry;
> }
> }
>
> Route with SJMS2, other settings as in the code above
>
>  @Override
> protected RouteBuilder createRouteBuilder() throws Exception {
> return new RouteBuilder() {
> public void configure() {
>
>
> from("sjms2://SJMS.CONSUMER.TEST?connectionFactory=#artemisCF=200=true")
>
> .to("sjms2://OUT.SJMS.CONSUMER.TEST?connectionFactory=#artemisCF");
> }
> };
> }
>
> How can I use the SJMS2 component to get the same speeds as JMS component?
>


SJMS2 vs JMS components for transfer messages from and to ActiveMQ Artemis

2020-02-26 Thread Mikhail Lukyanov
I am trying to find the fastest way to transfer messages from one ActiveMQ
queue to another Artemis. And I thought that the SJMS2 component would be
faster than traditional JMS, but routing with JMS is 2.5 times faster (20
000 vs 8000 msg/s). I use Camel version 2.20.2 and Artemis version 2.11.0.

Route with JMS

import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
import org.messaginghub.pooled.jms.JmsPoolConnectionFactory;

import javax.jms.ConnectionFactory;
import java.util.concurrent.TimeUnit;

public class JMSTransferTest extends CamelTestSupport {
@Test
public void testArtemis() throws Exception {
TimeUnit.SECONDS.sleep(100);
}

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

from("jms://TEST.IN?connectionFactory=#artemisCF=200")
.to("jms://TEST.OUT?connectionFactory=#artemisCF");
}
};
}

@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();

final ConnectionFactory connFactory = new
ActiveMQConnectionFactory("tcp://localhost:61622");
final ConnectionFactory connFactoryDeadLeatter = new
ActiveMQConnectionFactory("tcp://localhost:61622");
JmsPoolConnectionFactory pooledConnectionFactory = new
JmsPoolConnectionFactory();

pooledConnectionFactory.setConnectionFactory(connFactory);
pooledConnectionFactory.setMaxConnections(20);
pooledConnectionFactory.setMaxSessionsPerConnection(100);
registry.bind("artemisCF", pooledConnectionFactory);
registry.bind("deadLetterCF", connFactoryDeadLeatter);
return registry;
}
}

Route with SJMS2, other settings as in the code above

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

from("sjms2://SJMS.CONSUMER.TEST?connectionFactory=#artemisCF=200=true")

.to("sjms2://OUT.SJMS.CONSUMER.TEST?connectionFactory=#artemisCF");
}
};
}

How can I use the SJMS2 component to get the same speeds as JMS component?