Re: Exponentially growing latency while processing using textline codec

2016-11-11 Thread Steve973
Mina is either not maintained anymore, or it's not maintained very often.
Have you considered using the netty4 component?  There are lots of tuning
options that you can use for it.

On Fri, Nov 11, 2016 at 1:43 PM, pong2016  wrote:

> We are using JBoss Fuse with Camel/Mina2 to handle TCP traffic from a
> Northbound interface that sends XML. This is then processed via a Camel
> route(Active MQ) towards Southbound in another format.
>
> While load testing, we created 5000 individual TCP sessions (in ~3 secs.)
> and for each of these sessions, the client sent the same one liner text
> towards JBoss Fuse using Camel running Mina2. We configured the mina2 in
> our
> blueprint as follows:
>
> / uri="mina2:tcp://{{mina-ip}}:{{mina-port}}?lazySessionCreation=false
> noReplyLogLevel=OFFexchangePattern=InOut
> minaLogger=truetextline=truetextlineDelimiter=
> DEFAULTfilters=#keepAliveFilter{{ssl-context-parameters}}"/>/
>
> What we notice is that the throughput (*The time that the message is
> received for decoding to the time that it is sent to the ActiveMQ route;
> essentially the time consumed by the textline codec*) just keeps increasing
> exponentially. For the first call (of these 5000) to be processed by the
> textline codec took 2 ms. and the last call took 7 *minutes*. We don't
> understand why Mina2 is not able to handle this. The only relevant debug
> log
> in ProtocolCodecFilter is:
> /"Processing a MESSAGE_RECEIVED for session"/
> which doesn't give a clue where the bottleneck is. Since textlineCodec is
> the default for Mina2, we expected a great performance out of the box. So
> this is a surprise.
>
> Before diving in using a profiler, we just wanted run this question through
> the users' forum to see if we might be overlooking any blind spots. All
> ideas/tips are welcome.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Exponentially-growing-latency-while-processing-using-textline-codec-
> tp5790070.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Exponentially growing latency while processing using textline codec

2016-11-11 Thread pong2016
We are using JBoss Fuse with Camel/Mina2 to handle TCP traffic from a
Northbound interface that sends XML. This is then processed via a Camel
route(Active MQ) towards Southbound in another format.

While load testing, we created 5000 individual TCP sessions (in ~3 secs.)
and for each of these sessions, the client sent the same one liner text
towards JBoss Fuse using Camel running Mina2. We configured the mina2 in our
blueprint as follows:

//

What we notice is that the throughput (*The time that the message is
received for decoding to the time that it is sent to the ActiveMQ route;
essentially the time consumed by the textline codec*) just keeps increasing
exponentially. For the first call (of these 5000) to be processed by the
textline codec took 2 ms. and the last call took 7 *minutes*. We don't
understand why Mina2 is not able to handle this. The only relevant debug log
in ProtocolCodecFilter is:
/"Processing a MESSAGE_RECEIVED for session"/
which doesn't give a clue where the bottleneck is. Since textlineCodec is
the default for Mina2, we expected a great performance out of the box. So
this is a surprise.

Before diving in using a profiler, we just wanted run this question through
the users' forum to see if we might be overlooking any blind spots. All
ideas/tips are welcome.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Exponentially-growing-latency-while-processing-using-textline-codec-tp5790070.html
Sent from the Camel - Users mailing list archive at Nabble.com.


suppress zookeeper leader selection exception

2016-11-11 Thread a746076drdrb
Hello,

I'm using ZooKeeperRoutePolicy to select the leader and on non-leader
members I get of course the exception, which I'd like to suppress and just
log something like "skipping exchange on non-leader node"

Now, I know I could use onException clause but it would potentially catch
all others IllegalStateException's. It would be nice to have either an
option to throw more specific exception or route it somewhere else?

It's not a big deal, but just wonder if it is possible

15:44:16 [Camel (camel-1) thread #1 - timer://fire] ERROR deadletter -
Exchange[ExchangePattern: InOnly, BodyType: null, CaughtExceptionType:
java.lang.IllegalStateException, CaughtExceptionMessage: Zookeeper based
route policy prohibits processing exchanges, stopping route and failing the
exchange, StackTrace: java.lang.IllegalStateException: Zookeeper based route
policy prohibits processing exchanges, stopping route and failing the
exchange
at
org.apache.camel.component.zookeeper.policy.ZooKeeperRoutePolicy.onExchangeBegin(ZooKeeperRoutePolicy.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)





--
View this message in context: 
http://camel.465427.n5.nabble.com/suppress-zookeeper-leader-selection-exception-tp5790063.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: 'host' configuration param not used by servlet

2016-11-11 Thread Pontus Ullgren
I agree with Jonas original comment.

Since camel-swagger-java allows for explicitly setting a hostname it should
have precedence over the hostname taken from the servlet context
(regardless if it in turn is taken from 'X-Forwarded-Host' or 'Host').

@Jonas: I would suggest that you log a Jira with your findings.

// Pontus


On Fri, 11 Nov 2016 at 03:26 Vitalii Tymchyshyn  wrote:

> In Tomcat you can add
>
> https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html
>
> Ср, 2 лист. 2016 о 13:51 Jonas Koperdraat  пише:
>
> > Hi Zoran,
> >
> > I've checked and the proxy sets the 'X-Forwarded-Host' header and this
> > contains the 'correct' host. The 'Host' header is also present on the
> > request and this contains the hostname of the actual machine the servlet
> is
> > running on. I'm not sure if we have the option to set it, but seeing as
> we
> > already have the desired hostname available in de 'X-Forwarded-Host'
> option
> > I'm not going to investigate that further ;-)
> >
> > But I guess our servlet container, which indeed is Tomcat, doesn't take
> the
> > X-Forwarded-Host header into consideration when constructing the
> requestUrl
> > parameter of the SerlvetRequest. So we'll have to manually insert the
> > desired hostname into the request url.
> >
> > Kind regards,
> >
> > Jonas
> >
> > Op wo 2 nov. 2016 om 16:33 schreef Zoran Regvart :
> >
> > > Hi Jonas,
> > >
> > > On Wed, Nov 2, 2016 at 4:25 PM, Jonas Koperdraat
> > >  wrote:
> > > > I don't know whether that header is being sent by the proxy. Should
> > that
> > > > impact the behavior I am seeing (e.g. should does that influence the
> > > result
> > > > of getRequestURL)?
> > >
> > > It does on some Servlet engines / middlewares, it might not in your
> > > case, especially if you're using Tomcat.
> > >
> > > Another header that you might want to investigate is the `Host`
> > > header, it's used for virtual hosts, and you might have an option to
> > > set it in your proxy (on the request sent to the backend).
> > >
> > > zoran
> > > --
> > > Zoran Regvart
> > > zregv...@redhat.com
> > >
> >
>


Re: NotifyBuilder Behaviour

2016-11-11 Thread Tomohisa Igarashi

Hmm... I took a look at the code but looks confusing to me.

At first, direct:route2 and direct:route3 invocation doesn't produce 
ExchangeCompleted event, as DirectProducer doesn't create new Exchange but 
invoke consumer Processor directly.
However when from()'s predicate is evaluated in matches(), it always returns 
true, so ExchangeCompleted event for the direct:route1 exchange is also counted 
for route2 and route3.
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java#L126

ExchangeCompleted event increments the count in the predicate added by 
whenExactlyDone() here
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java#L568

Second however, if from()'s predicate is put prior to whenExactlyDone(), 
ExchangeCompleted event is not delivered to the whenExactlyDone()'s predicate
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java#L1576

That's the reason why #2 and #3 are false.

So, at least whenExactlyDone() doesn't work for internal(direct) routing right 
now. As it seems ExchangeSent event is sent for internal routing as well, 
wereSentTo() would work for that purpose instead.

According to the comment, that's intended to always return true on matches() in 
from()'s predicate, so I'm not exactly sure how it should be. I think 
ExchangeCompleted event should be delivered to all the predicates regardless of 
the previous result though.

Would anyone else help?

Thanks,
Tomo

On 11/11/2016 01:18 PM, Tomohisa Igarashi wrote:

Hi,

Hmm this looks weird. The predicates order shouldn't matter. Would you file a 
JIRA?

Thanks,
Tomo

On 11/10/2016 06:13 PM, sohrab wrote:

I've read the page on NotifyBuilder but I don't think I really understood how
it works. So I wrote below test case to verify it. The results confound me.

(The Groovy script is standalone and fully functioning so feel free to run
it locally.)

Code
===

@Grab(group='org.apache.camel', module = 'camel-core', version='2.15.1')
import java.util.concurrent.TimeUnit
import org.apache.camel.builder.*
import org.apache.camel.impl.DefaultCamelContext

def context = new DefaultCamelContext()
context.addRoutes(new RouteBuilder() {
void configure() {
from('direct:route1').routeId('route1')
.log('route 1 started')
.to('direct:route2')
.log('route 1 ended')
from('direct:route2').routeId('route2')
.log('route 2 started')
.to('direct:route3')
.log('route 2 ended')
from('direct:route3').routeId('route3')
.log('route 3 started and ended')
}
})
context.start()

def notifies = [
new
NotifyBuilder(context).from('direct:route1').whenExactlyDone(1).create(),
new
NotifyBuilder(context).from('direct:route2').whenExactlyDone(1).create(),
new
NotifyBuilder(context).from('direct:route3').whenExactlyDone(1).create(),
new
NotifyBuilder(context).whenExactlyDone(1).from('direct:route1').create(),
new
NotifyBuilder(context).whenExactlyDone(1).from('direct:route2').create(),
new
NotifyBuilder(context).whenExactlyDone(1).from('direct:route3').create()
]
context.createProducerTemplate().requestBody 'direct:route1', 'something'
notifies.eachWithIndex { it, i -> println "$i: ${it.matches()}"  }


STDOUT
===

0: true
1: false
2: false
3: true
4: true
5: true


I understand the predicates are stacked but can someone please explain the
above behaviour to me?



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



Re: camel-mail: Body ends up as attachment instead of e-mail body in multipart mail.

2016-11-11 Thread Andreas A.
Thanks guys, setting the content type to text/plain did the trick.



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-mail-Body-ends-up-as-attachment-instead-of-e-mail-body-in-multipart-mail-tp5789939p5790037.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-kafka Unknown parameters zookeeperHost, zookeeperPort

2016-11-11 Thread Andrea Cosentino
Because from 2.17 to 2.18 we upgrade Kafka to 0.10.x

https://github.com/apache/camel/blob/camel-2.18.x/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java

We are now using only the Java API for both producer and consumer.
 --
Andrea Cosentino 
--
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix Committer
Email: ancosen1...@yahoo.com
Twitter: @oscerd2
Github: oscerd



On Friday, November 11, 2016 9:17 AM, Damage_Shadow  wrote:
Using latest camel-parent / camel-kafka


org.apache.camel
camel-parent
2.18.0


1st problem - Need to explicitly add kafka_2.11 dependency as in camel-kafka
scope was changed to test.
2nd problem - Even if kafka_2.11 added, camel route fails to start :
Route:

from("kafka:{{UIKafkaIPAddress}}:{{KafkaPort}}" +
"?topic={{TopicName}}" +
"={{UIKafkaIPAddress}}" +
"={{ZookeeperPort}}" +
"={{KafkaGroupId}}" +
"=kafka.serializer.StringDecoder")
.log(LoggingLevel.INFO, simple("Raw ${body}").toString())

Exception : 

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint:
kafka://10.10.14.127:9092?groupId=group1=kafka.serializer.StringDecoder=topic=10.10.14.127=2181
due to: There are 2 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{zookeeperHost=10.10.14.127,
zookeeperPort=2181}]

Why Zookeeper options were removed?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-kafka-Unknown-parameters-zookeeperHost-zookeeperPort-tp5790021.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-kafka Unknown parameters zookeeperHost, zookeeperPort

2016-11-11 Thread Damage_Shadow
Using latest camel-parent / camel-kafka

 
org.apache.camel
camel-parent
2.18.0


1st problem - Need to explicitly add kafka_2.11 dependency as in camel-kafka
scope was changed to test.
2nd problem - Even if kafka_2.11 added, camel route fails to start :
Route:

from("kafka:{{UIKafkaIPAddress}}:{{KafkaPort}}" +
"?topic={{TopicName}}" +
"={{UIKafkaIPAddress}}" +
"={{ZookeeperPort}}" +
"={{KafkaGroupId}}" +
"=kafka.serializer.StringDecoder")
.log(LoggingLevel.INFO, simple("Raw ${body}").toString())

Exception : 

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint:
kafka://10.10.14.127:9092?groupId=group1=kafka.serializer.StringDecoder=topic=10.10.14.127=2181
due to: There are 2 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{zookeeperHost=10.10.14.127,
zookeeperPort=2181}]

Why Zookeeper options were removed?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-kafka-Unknown-parameters-zookeeperHost-zookeeperPort-tp5790021.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: quartz2 component on wildfly 10.1

2016-11-11 Thread freakwave10
Hi John,

just to make sure, I use now a very clean war file, that has basically only
CDI component and one camel routeBuilder class deployed.


package com.kona.camel.routes;
import javax.enterprise.context.ApplicationScoped;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
import org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy;
import com.kona.cdi.annotation.Startup;

@Startup
@ApplicationScoped
@ContextName("cdi-context")
public class MyRouteBuilder extends RouteBuilder {

@Override
public void configure() throws Exception {
CronScheduledRoutePolicy startPolicy = new CronScheduledRoutePolicy();
startPolicy.setRouteStartTime("*/10 * * * * ?");
from("direct:start").routeId("testRoute").routePolicy(startPolicy)
.from("sql:select * from seamv2.geosecmgr?dataSource=#epmDataSoruce")
.to("log:sql?showAll=true");
}
}

Same issue, the scheduler always uses the quartz.properties that comes with
the fuse wildfly module.
RAM Job Store and the job can not be stored because it already exists.

jboss-log.txt
  

I uploaded the jboss log file.

Thanks for your help,

Wolfgang





--
View this message in context: 
http://camel.465427.n5.nabble.com/quartz2-component-on-wildfly-10-1-tp5789975p5790020.html
Sent from the Camel - Users mailing list archive at Nabble.com.