Re: Simple IN with empty value in list

2016-12-02 Thread Karts
Thanks Claus, the double comma works well.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Simple-IN-with-empty-value-in-list-tp5790907p5790960.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[ANNOUNCEMENT] Apache Camel 2.18.1 Released

2016-12-02 Thread Gregor Zurowski
The Camel community announces the immediate availability of the new
patch release Camel 2.18.1. This release contains 68 bug fixes and
improvements applied in the past months by the community on the Camel
2.18.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-2181-release.html
[3] 
https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12338295=12311211


Camel-ZooKeeperRoutePolicy clarification - Slave Camel does not start after Master Camel shutdown

2016-12-02 Thread Baltej Singh
Second Attempt for feedback - Slave Camel does not start after Master Camel 
shutdown

Steps

1.  Start Master and Slave in separate cmds

2.  Master Camel server starts properly and prints message.

I was fired at Fri Nov 18 15:18:28 PST 2016

I was fired at Fri Nov 18 15:18:30 PST 2016

I was fired at Fri Nov 18 15:18:32 PST 2016

...

3.  Slave Camel server is started but not processing route, as expected.

4.  Kill Master - expect Slave to start route, but Slave route never starts


From: Baltej Singh
Sent: Friday, November 18, 2016 3:34 PM
To: 'users@camel.apache.org' 
Subject: Camel-ZooKeeperRoutePolicy clarification - Slave Camel does not start 
after Master Camel shutdown

Hello,

I a simple application to test my first zookeeper/camel cluster.
When I Kill the Master Camel server, I expect Slave to start route, but Slave 
route never starts.
What is missing in the java code?

Thanks,
Baltej

Java code - Started with Camel in Action 2 sample quartz route

public class QuartzCronWithPolicy {

   public static void main(String args[]) throws Exception {

 CamelContext context = new DefaultCamelContext();
 ZooKeeperComponent zookeeperComponent = new ZooKeeperComponent();
 ZooKeeperConfiguration zooConfig = new ZooKeeperConfiguration();
zooConfig.addZookeeperServer("localhost:2182");
zooConfig.addZookeeperServer("localhost:2183");
zookeeperComponent.setConfiguration(zooConfig);

 context.addRoutes(new RouteBuilder() {
 public void configure() {
ZooKeeperRoutePolicy zooKeeperRoutePolicy = new 
ZooKeeperRoutePolicy("zookeeper://localhost:2181/ELECTION", 1);

from("quartz2://report?cron=0/2+*+*+*+*+?")
.routePolicy(zooKeeperRoutePolicy)
.setBody().simple("I was fired at ${header.fireTime}")
.to("stream:out")
.to("mock:end");
 }
 });

 context.start();
   }
}
Followed docs at:
http://camel.apache.org/zookeeper.html
Camel setup, followed:
http://frommyworkshop.blogspot.com/2013/06/leader-election-of-camel-router-through.html
Zookeeper setup, followed:
http://myjeeva.com/zookeeper-cluster-setup.html







Environment
Using Camel 2.17.3 and zookeeper-3.4.9
3 nodes in zookeeper cluster
2 Camel nodes  Master/Slave
Route prints a message every 2 seconds.





Zookeeper data tree
C:\tools\zookeeper\data>tree
Folder PATH listing for volume RAW7121218
Volume serial number is 0C09-AE01
C:.
├───zk1
│   └───version-2
├───zk2
│   └───version-2
├───zk3
│   └───version-2


Zookeeper Log
2016-11-18 10:56:08,196 [myid:1] - WARN  
[QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:Follower@116] - Got zxid 0x70001 
expected 0x1
2016-11-18 10:56:08,282 [myid:1] - INFO  
[CommitProcessor:1:ZooKeeperServer@673] - Established session 0x158787a0a7f 
with negotiated timeout 5000
for client /0:0:0:0:0:0:0:1:2872
2016-11-18 10:56:08,287 [myid:1] - INFO  
[CommitProcessor:1:ZooKeeperServer@673] - Established session 0x158787a0a7f0001 
with negotiated timeout 5000
for client /0:0:0:0:0:0:0:1:2873
2016-11-18 10:57:03,968 [myid:1] - WARN  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@362] - Exception 
causing close of session 0x158787a0
a7f0001 due to java.io.IOException: An existing connection was forcibly closed 
by the remote host
2016-11-18 10:57:03,988 [myid:1] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1008] - Closed socket 
connection for client /0:0:0:0
:0:0:0:1:2873 which had sessionid 0x158787a0a7f0001
2016-11-18 10:58:33,251 [myid:1] - WARN  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@362] - Exception 
causing close of session 0x158787a0
a7f due to java.io.IOException: An existing connection was forcibly closed 
by the remote host
2016-11-18 10:58:33,251 [myid:1] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1008] - Closed socket 
connection for client /0:0:0:0
:0:0:0:1:2872 which had sessionid 0x158787a0a7f


Re: Simple IN with empty value in list

2016-12-02 Thread Claus Ibsen
Hi

Yeah that would work, but I just checked you can get empty value if
you use double comma, eg

',,gold,silver'

On Fri, Dec 2, 2016 at 5:46 PM, Quinn Stevenson
 wrote:
> Maybe something like this would work?
>
> .choice.when.simple("${body.stringValue.isEmpty} || ${body.stringValue} in 
> 'gold,silver’")
>
>> On Dec 2, 2016, at 9:23 AM, Claus Ibsen  wrote:
>>
>> I dont think an empty value is supported
>>
>> On Fri, Dec 2, 2016 at 3:59 PM, Karts  wrote:
>>> Sorry, to be clear, body.stringValue could be "", "gold", "silver", 
>>> "bronze",
>>> "platinum", etc.
>>>
>>> I am trying to test so that only "", "gold" or "silver" are allowed before
>>> moving forward, which is why I have the comma at the start, to allow for a
>>> blank (not null) value:
>>>
>>> .choice.when.simple("${body.stringValue} in ',gold,silver'")
>>>
>>> But I'm finding if body.stringValue="", it does not satisfy the condition.
>>> Is there another way I can do this?
>>>
>>> Thanks
>>>
>>>
>>>
>>> --
>>> View this message in context: 
>>> http://camel.465427.n5.nabble.com/Simple-IN-with-empty-value-in-list-tp5790907p5790926.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Simple IN with empty value in list

2016-12-02 Thread Karts
In the end I just used .process() before the choice, got body.stringValue in
the Java code, tested and set an exchange header "isValid" to "true" if so,
and then subsequently tested for this in simple.

I didn't use something like .choice.when.simple("${body.stringValue.isEmpty}
|| ${body.stringValue} in 'gold,silver’")  as the simple block has multiple
&& and parentheses aren't supported yet for an || condition inside of there,
i.e. operator precedence. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Simple-IN-with-empty-value-in-list-tp5790907p5790937.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Simple IN with empty value in list

2016-12-02 Thread Quinn Stevenson
Maybe something like this would work?

.choice.when.simple("${body.stringValue.isEmpty} || ${body.stringValue} in 
'gold,silver’")

> On Dec 2, 2016, at 9:23 AM, Claus Ibsen  wrote:
> 
> I dont think an empty value is supported
> 
> On Fri, Dec 2, 2016 at 3:59 PM, Karts  wrote:
>> Sorry, to be clear, body.stringValue could be "", "gold", "silver", "bronze",
>> "platinum", etc.
>> 
>> I am trying to test so that only "", "gold" or "silver" are allowed before
>> moving forward, which is why I have the comma at the start, to allow for a
>> blank (not null) value:
>> 
>> .choice.when.simple("${body.stringValue} in ',gold,silver'")
>> 
>> But I'm finding if body.stringValue="", it does not satisfy the condition.
>> Is there another way I can do this?
>> 
>> Thanks
>> 
>> 
>> 
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Simple-IN-with-empty-value-in-list-tp5790907p5790926.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 
> -- 
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



Re: Simple IN with empty value in list

2016-12-02 Thread Claus Ibsen
I dont think an empty value is supported

On Fri, Dec 2, 2016 at 3:59 PM, Karts  wrote:
> Sorry, to be clear, body.stringValue could be "", "gold", "silver", "bronze",
> "platinum", etc.
>
> I am trying to test so that only "", "gold" or "silver" are allowed before
> moving forward, which is why I have the comma at the start, to allow for a
> blank (not null) value:
>
> .choice.when.simple("${body.stringValue} in ',gold,silver'")
>
> But I'm finding if body.stringValue="", it does not satisfy the condition.
> Is there another way I can do this?
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Simple-IN-with-empty-value-in-list-tp5790907p5790926.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Activemq consumer is closing

2016-12-02 Thread boday
we set the idleTimeout to 0 in the PooledConnectionFactory config like
this...



**




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

--
View this message in context: 
http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5790930.html
Sent from the Camel - Users mailing list archive at Nabble.com.


using externalized xslt for transformation from server

2016-12-02 Thread ravi21588
Hi All,
Iam using camel 2.10 with Jboss EAP 6.1 server.
I would like to externalize XSLT for transformation by placing it as a file
in some location in server.
Can you please let me know how can i acheive.
The XSLT transformation frequently changes,will the xslt be picked correctly
without any restart?





--
View this message in context: 
http://camel.465427.n5.nabble.com/using-externalized-xslt-for-transformation-from-server-tp5790927.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Simple IN with empty value in list

2016-12-02 Thread Karts
Sorry, to be clear, body.stringValue could be "", "gold", "silver", "bronze",
"platinum", etc.

I am trying to test so that only "", "gold" or "silver" are allowed before
moving forward, which is why I have the comma at the start, to allow for a
blank (not null) value:

.choice.when.simple("${body.stringValue} in ',gold,silver'")

But I'm finding if body.stringValue="", it does not satisfy the condition.
Is there another way I can do this?

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Simple-IN-with-empty-value-in-list-tp5790907p5790926.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel Mail Component doesn't handle multiple attachments with same file name properly

2016-12-02 Thread Petteri

Hi,

I'm using Apache Camel and its mail component to read emails and their 
attachments.


I have encountered a problem which occurs when handling mails with 
multiple attachments using the same file name.


It seems that the problem is caused by the use of Map type in org.apache.camel.component.mail.MailBinding. 
Attachments are looped and checked against this map. If the map already 
contains a key with the same file name, attachment is skipped:


https://github.com/apache/camel/blob/camel-2.10.x/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java#L327

Maybe this key value could be somehow incremented so the map could 
contain all attachments despite of their file names?


I'm using Camel version 2.10.7 but the code seems to be unchanged by 
this part in current version too.


This kind of mails are regularly coming from end users of our software 
and there's no easy way to circumvent this from our side.


Thanks.



Re: Simple IN with empty value in list

2016-12-02 Thread Claus Ibsen
You have a comma before gold. It should just be 'gold,silver'

On Thu, Dec 1, 2016 at 11:33 PM, Karts  wrote:
> Hi,
>
> I'm trying to use simple to test for an empty value in a list, so something
> like:
>
> simple("${body.stringValue} in ',gold,silver'")
>
> It doesn't seem to work though, if body.stringValue is '' this fails.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Simple-IN-with-empty-value-in-list-tp5790907.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Activemq consumer is closing

2016-12-02 Thread Claus Ibsen
Hi

I suggest to ask on the ActiveMQ user mailing list.

On Fri, Dec 2, 2016 at 7:29 AM, nitinaggarwal
 wrote:
> Hi,
>
> I am using apache-activemq-5.14.1 and getting the below issue.
>
> javax.jms.IllegalStateException: The Consumer is closed
> at
> org.apache.activemq.ActiveMQMessageConsumer.checkClosed(ActiveMQMessageConsumer.java:880)
> at
> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:678)
> at
> org.apache.activemq.jms.pool.PooledMessageConsumer.receiveNoWait(PooledMessageConsumer.java:72)
> at
> com.irdeto.manager.endpoint.activemq.MessageConsumerManager$2.run(MessageConsumerManager.java:105)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
>
> Can you please tell how did you resolved it or in which file did you make
> the change.
>
> Thanks in advance
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5790912.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2