Re: How to stop a dynamic route

2016-06-08 Thread Daniel P22
Quinn and Ranx, guys have an example for controlbus, I don't understand how
works and how can I use it. I read camel.apache.org/controlbus.html



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783611.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to add Service on before camel route start

2016-06-08 Thread deepaktaker
Hi,
   I have written junits which mocks the endpoints.
but my problem is my code uses a service. so if i start the route i always
get nullpointer exception
because the service is not initialized. 
So my question is there a way to mock a service or add a service before a
route starts.

Regards,

Deepak



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-add-Service-on-before-camel-route-start-tp5783616.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to add Service on before camel route start

2016-06-08 Thread Steve973
Hi, Deepak.  When you say "service", are you referring to a bean that you
need to reference, by name, within the CamelContext that your route needs
to invoke a method on?  You can bind a bean to the registry of the context
before you start it.  How are you initializing the context for your tests?
If you can include your setup/initialization code, I can help you with it.

On Wed, Jun 8, 2016 at 4:51 AM, deepaktaker  wrote:

> Hi,
>I have written junits which mocks the endpoints.
> but my problem is my code uses a service. so if i start the route i always
> get nullpointer exception
> because the service is not initialized.
> So my question is there a way to mock a service or add a service before a
> route starts.
>
> Regards,
>
> Deepak
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-add-Service-on-before-camel-route-start-tp5783616.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Tracer doesn't work

2016-06-08 Thread nicolasduminil
Hi Claus,

Thanks for clarifying that. Reading the doc it didn't appear obviously.

Kind regards,

Nicolas



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Tracer-doesn-t-work-tp5783296p5783621.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to add Service on before camel route start

2016-06-08 Thread souciance
What is the service?

On Wed, Jun 8, 2016 at 11:11 AM, Steve973 [via Camel] <
ml-node+s465427n5783617...@n5.nabble.com> wrote:

> Hi, Deepak.  When you say "service", are you referring to a bean that you
> need to reference, by name, within the CamelContext that your route needs
> to invoke a method on?  You can bind a bean to the registry of the context
> before you start it.  How are you initializing the context for your tests?
> If you can include your setup/initialization code, I can help you with it.
>
> On Wed, Jun 8, 2016 at 4:51 AM, deepaktaker <[hidden email]
> > wrote:
>
> > Hi,
> >I have written junits which mocks the endpoints.
> > but my problem is my code uses a service. so if i start the route i
> always
> > get nullpointer exception
> > because the service is not initialized.
> > So my question is there a way to mock a service or add a service before
> a
> > route starts.
> >
> > Regards,
> >
> > Deepak
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/How-to-add-Service-on-before-camel-route-start-tp5783616.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/How-to-add-Service-on-before-camel-route-start-tp5783616p5783617.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-add-Service-on-before-camel-route-start-tp5783616p5783622.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SWAGGER same service into different war file!

2016-06-08 Thread Sergey Beryozkin

FYI,
https://issues.apache.org/jira/browse/CXF-6740

Note my colleagues worked on a patch which was accepted for Swagger 1.5.10

Not sure 100% it is the same issue which causes problems in your case 
but sounds like it is the one


Sergey
On 06/06/16 21:39, Sergey Beryozkin wrote:

It is a Swagger issue, we've had a similar issue opened in CXF

Sergey
On 06/06/16 10:54, fabryprog wrote:

Hello,

In my tomcat7 context i have same war project within camel.

 From version 2.16.3 i wanted to add swagger api into my projects.

But there are any mistakes. All swagger JSON files are the same!! Swagger
Camel plugin merge ALL REST service also if are into different WAR!!!

Is it a colossal BUG or is it my configuration error?

In All my project I have a same web.xml into war file, so all my
"Camel Rest
Servlet" have same name but there are in a different context-root!

Perhaps i must change servlet name? Any Suggestions?

I tried camel 2.17.1 version with same result!!

fabryprog



--
View this message in context:
http://camel.465427.n5.nabble.com/SWAGGER-same-service-into-different-war-file-tp5783489.html

Sent from the Camel - Users mailing list archive at Nabble.com.







--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/


Trying to use the TarSplitter ...

2016-06-08 Thread nicolasduminil
Hello,

I need to process a .tar.gz file in a route and, after some googling, I came
at something like the following:

...
from("direct:unzip").unmarshal().gzip()
.split(new TarSplitter()).process("debug")
...

I didn't find much documentation concerning TarSplitter and I'm wondering
whether it is a fully supported component. Also, in the "debug" processor, I
display inMessage.getBody().getClass().getName() which displays:

org.apache.camel.dataformat.tarfile.TarElementInputStreamWrapper

So, my question is how can I get either the file or its content out of this
?

Many thanks in advance.

Nicolas



--
View this message in context: 
http://camel.465427.n5.nabble.com/Trying-to-use-the-TarSplitter-tp5783658.html
Sent from the Camel - Users mailing list archive at Nabble.com.


query param

2016-06-08 Thread miri eyni


hi 

 i try to routing url with query param but i got the 400 server code .

http://{{fromUrl}}/billing/{paymentMethod}/{product}/{frequency}?matchOnUriPrefix=true"/>
http://{{toUrl}}/metadata/billing/{paymentMethod}/{product}/{frequency}?bridgeEndpoint=true"/>




how can i need to configure?



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


Camel CXF authentication

2016-06-08 Thread mabahma
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() throws Exception {


> Authenticator.setDefault(new MyAuthenticator());  


  from("direct:test")
 
 .setHeader("operationNamespace",
constant("urn:microsoft-dynamics-schemas/page/calculator"))
 .setHeader("operationName", constant("compute"))
.setHeader("SOAPAction",
constant("urn:microsoft-dynamics-schemas/page/calculator:compute"))
   
  .
to("cxf://http://localhost:9080/WS/calculator?wsdlURL=classpath:test.wsdl&;
dataFormat=PAYLOAD")
   
 
 }
});
   
context.start();
   
 String soap = "http://schemas.xmlsoap.org/soap/envelope/\";>8545";
  
 
Endpoint endpoint =
context.getEndpoint("direct:test");
Exchange exchange = endpoint.createExchange();
ProducerTemplate template =
exchange.getContext().createProducerTemplate();
   
 // send to default endpoint
 template.sendBody(endpoint,soap);


where 


MyAuthenticator  :

MyAuthenticator extends Authenticator {

private final static String DOMAIN = "domain";
private final static String SEPARATOR = "\\";
private final static String USER = "user";
private final static String PASSWORD = "pass";

@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(DOMAIN + SEPARATOR
+ USER,PASSWORD.toCharArray());
}
}



This is working

but i'm trying to do it the spring xml way.


I'have tried by adding this to camel xml file  :
--





domain\\user
pass






---

but i have HTTP response '401: Unauthorized' when communicating with
http:...


Any idea ?

Kin regards



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


XPath Content Based Routine Fails when urn xmlns is specified in base element.

2016-06-08 Thread bbuzzard
I am using JDK1.7 with apache-activemq-5.13.2 which is using
canel-core-5.13.2. 

I am trying to route documents based on the value of an XML element.  My
test route should routes documents to the "when" folder when the author's
name is "Bob" and it routes documents to the "otherwise" folder when the
author's name does not match "Bob".  The route worked great until I started
added an xmlns containing a urn to the base element.  As soon as I added the
urn all documents when to the "otherwise" folder.  Adding a xmlns containing
a URL works.  The documents that I expect to process will contain the URN. 
What must I do to get this CBR working?

test1.xml will correctly route because it does NOT contain an URN in the
base element.  test2.xml will NOT route correctly because it does contain an
URN in the base element.  The "camel.xml" file contains my simple CBR".

camel.xml   
test1.xml   
test2.xml   



--
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: REST DSL bind mode per endpoint

2016-06-08 Thread Mark
figured it out.  You can specify this per get/post..etc.


On Tue, Jun 7, 2016 at 11:51 PM, Mark  wrote:

> I have a REST API that ingests XML via a POST endpoint and I also have an
> endpoint that will produce text/plain via GET.  Is it possible to have the
> POST endpoint use JAXB and the GET endpoint produce text/plain?  So for
> instance, I would like to have the following:
>
> 
>
>  "com.a.b.c.TestDocument">
> 
> 
>
> 
> Status service
> 
> 
> 
> 
>
> 
>


Re: XPath Content Based Routine Fails when urn xmlns is specified in base element.

2016-06-08 Thread souciance
Take a lot at the namespace section in the documentation:
http://camel.apache.org/xpath.html
There is an example there for adding namespace support but it seems to be
for the java dsl. For the xml dsl you may need to add the namespace
manually in the xml declaration. Perhaps someone also knows if you
construct namespaces using the xml dsl?



On Wed, Jun 8, 2016 at 3:37 PM, bbuzzard [via Camel] <
ml-node+s465427n5783701...@n5.nabble.com> wrote:

> I am using JDK1.7 with apache-activemq-5.13.2 which is using
> canel-core-5.13.2.
>
> I am trying to route documents based on the value of an XML element.  My
> test route should routes documents to the "when" folder when the author's
> name is "Bob" and it routes documents to the "otherwise" folder when the
> author's name does not match "Bob".  The route worked great until I started
> added an xmlns containing a urn to the base element.  As soon as I added
> the urn all documents when to the "otherwise" folder.  Adding a xmlns
> containing a URL works.  The documents that I expect to process will
> contain the URN.  What must I do to get this CBR working?
>
> test1.xml will correctly route because it does NOT contain an URN in the
> base element.  test2.xml will NOT route correctly because it does contain
> an URN in the base element.  The "camel.xml" file contains my simple CBR".
>
> camel.xml 
> test1.xml 
> test2.xml 
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701p5783715.html
Sent from the Camel - Users mailing list archive at Nabble.com.

news from me

2016-06-08 Thread sanjai
Hello,

I've got some interesting news for you, you're gonna be pleaseantly surprised. 
Read more here  

san...@sanjai.org





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

how you're doing?

2016-06-08 Thread sanjai
Hi,

Just wanted to say hi and ask how you're doing? I'm OK, you may read my latest 
article here 

Sincerely, san...@sanjai.org





--
View this message in context: 
http://camel.465427.n5.nabble.com/how-you-re-doing-tp5783720.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Trying to use the TarSplitter ...

2016-06-08 Thread Pontus Ullgren
You can try to convert the input stream to the desired format using
convertBodyTo before the debug processor.

http://camel.apache.org/convertbodyto.html

Best regards
Pontus

On Wed, 8 Jun 2016, 11:46 nicolasduminil, <
nicolas.dumi...@simplex-software.fr> wrote:

> Hello,
>
> I need to process a .tar.gz file in a route and, after some googling, I
> came
> at something like the following:
>
> ...
> from("direct:unzip").unmarshal().gzip()
> .split(new TarSplitter()).process("debug")
> ...
>
> I didn't find much documentation concerning TarSplitter and I'm wondering
> whether it is a fully supported component. Also, in the "debug" processor,
> I
> display inMessage.getBody().getClass().getName() which displays:
>
> org.apache.camel.dataformat.tarfile.TarElementInputStreamWrapper
>
> So, my question is how can I get either the file or its content out of this
> ?
>
> Many thanks in advance.
>
> Nicolas
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Trying-to-use-the-TarSplitter-tp5783658.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Trying to use the TarSplitter ...

2016-06-08 Thread nicolasduminil
Hello,

Thanks for your reply. So, what you're saying is that
org.apache.camel.dataformat.tarfile.TarElementInputStreamWrapper would be an
input stream, right ? In this case I don't need to convert it, just could
read from it. But I tried the following:

from("direct:unzip").unmarshal().gzip()
.split(new TarSplitter())
.to("file:{{file.unzip.path}}?fileName=${file:name}");

The file-system structure gets correctly created, I mean folders,
sub-folders, etc., until the file level. But all the files are created with
0 blocks, i.e. empty. Do you have any idea of what might happening here ?

Many thanks in advance,

Nicolas




--
View this message in context: 
http://camel.465427.n5.nabble.com/Trying-to-use-the-TarSplitter-tp5783658p5783722.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to stop a dynamic route

2016-06-08 Thread Brad Johnson
I'm going to echo Quinn's question, why do you think you need to remove the
route?  Even if it is only used once and only once you can (a) disable or
(b) make sure it only processes files idempotently so that you don't end up
reprocessing the file.  You may have a compelling reason I just don't know
what you are trying to achieve that isn't more easily achieved by just
setting the flags on the endpoint.

On Wed, Jun 8, 2016 at 2:07 AM, Daniel P22  wrote:

> Quinn and Ranx, guys have an example for controlbus, I don't understand how
> works and how can I use it. I read camel.apache.org/controlbus.html
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783611.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Removing and reloading Rests XML Definitions dynamically

2016-06-08 Thread jmandawg
Hi,

I'm trying to remove and reload rest definitions from xml using camel
2.17.1.  I have the following code to load them (stolen from
camel-spring-boot):

for(String restRoutePath : restRoutePaths) {
   try{
   RestsDefinition rd =
camelContext.loadRestsDefinition(appContext.getResource(restRoutePath).getInputStream());
   camelContext.addRestDefinitions(rd.getRests());
   for(RestDefinition xmlDef : rd.getRests()) {
   List routeDefs =
xmlDef.asRouteDefinition(camelContext);
   camelContext.addRouteDefinitions(routeDefs);
   //Store loaded Routes
   loadedRouteDefs.addAll(routeDefs);
   }
   } catch(Exception ex){
   ex.printStackTrace();
   }
   }

To remove the routes I use:
camelContext.removeRouteDefinitions(loadedRouteDefs);

But then when i try to reload the xml again, i get the following error which
makes me think the Rest definitions are not getting completely removed.  It
works fine for regular xml Routes, just not Rest.


org.apache.camel.FailedToStartRouteException: Failed to start route route71
because of duplicate id detected: route75. Please correct ids to be unique
among all your routes.
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:963)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3295)
at
org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:908)
at com.transamerica.isb.api.interfaces.Utils.loadRoutes(Utils.java:90)
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:497)




--
View this message in context: 
http://camel.465427.n5.nabble.com/Removing-and-reloading-Rests-XML-Definitions-dynamically-tp5783724.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: XPath Content Based Routine Fails when urn xmlns is specified in base element.

2016-06-08 Thread bbuzzard
Thank you for your response, but I think you missed the point.  The
http://camel.apache.org/xpath.html talks about namespaces that use URLs not
URNs.  My problem seems to be specifically with namespaces that use URNs.  I
need to know if there is a way for the CBR to ignore the default URN
namespace and if so how?  If the default URN namespace cannot be ignored
then how so I register the URN namespace using Camel-Spring?



--
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701p5783727.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to stop a dynamic route

2016-06-08 Thread Daniel P22
I need to start the route, process the files once and then stop and remove
the route.

Then the route maybe in future can be started again and I need the route
process the same files again.

Maybe I dont need to destroy the route but at least stop. And I have to
stopped when the CamelBatchComplete is true.

Thanks.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783728.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: XPath Content Based Routine Fails when urn xmlns is specified in base element.

2016-06-08 Thread bbuzzard
Thanks to souciance's reply I was able to figure out what I was doing wrong. 
test2.xml defined the default namespace to an URN.  In my CBR I had
specified an xpath that had no namespace at all.  When I added the URN
namespace to my camelContext and then prefixed the XPath element with the
namespace prefix, everything worked. 







--
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-Content-Based-Routine-Fails-when-urn-xmlns-is-specified-in-base-element-tp5783701p5783730.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to stop a dynamic route

2016-06-08 Thread Brad Johnson
Processing the files once is what the idempotent flag is for as noted.  It
won't reprocess the same files. The route is still there but it won't
continually respin over your file.

On Wed, Jun 8, 2016 at 10:48 AM, Daniel P22  wrote:

> I need to start the route, process the files once and then stop and remove
> the route.
>
> Then the route maybe in future can be started again and I need the route
> process the same files again.
>
> Maybe I dont need to destroy the route but at least stop. And I have to
> stopped when the CamelBatchComplete is true.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-stop-a-dynamic-route-tp5783385p5783728.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Removing and reloading Rests XML Definitions dynamically

2016-06-08 Thread jmandawg
It seems For some reason RouteBuilder does not check the camelContext for
existing restConfiguration before it goes and creates it's own resulting in
multple restConfigurations.  

#RouteBuilder
public RestConfigurationDefinition restConfiguration(String component) {
if (restConfigurations == null) {
restConfigurations = new HashMap();
}
RestConfigurationDefinition restConfiguration =
restConfigurations.get(component);
if (restConfiguration == null) {
restConfiguration = new RestConfigurationDefinition();
if (!component.isEmpty()) {
restConfiguration.component(component);
}
restConfigurations.put(component, restConfiguration);
}
return restConfiguration;
}


Is this how it's supposed to be?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Removing-and-reloading-Rests-XML-Definitions-dynamically-tp5783724p5783732.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Removing and reloading Rests XML Definitions dynamically

2016-06-08 Thread jmandawg
So the real problem is, after the app starts I have like 3 RestConfigurations
(jetty, netty-http, restlet) and when i call: 

 List routeDefs = xmlDef.asRouteDefinition(camelContext,
getContext().getRestConfiguration());

It creates a route for each RestConfiguration, which is not what i want.  I
only want them running on the netty-http.

Does it make sense to add this method to RestDefinition so that you can
choose the RestConfiguration you want the route added to?

public List asRouteDefinition(CamelContext camelContext,
RestConfiguration restConfig) {
// sanity check this rest definition do not have duplicates
validateUniquePaths();

List answer = new ArrayList();

addRouteDefinition(camelContext, answer, restConfig.getComponent());

return answer;
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/Removing-and-reloading-Rests-XML-Definitions-dynamically-tp5783724p5783733.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Trying to use the TarSplitter ...

2016-06-08 Thread Pontus Ullgren
Yes agree,

I also get the same behaviour from a similare route when running Camel
2.17.1.

Could you create a issue in Jira for this.

// Pontus

On Wed, 8 Jun 2016 at 17:23 nicolasduminil <
nicolas.dumi...@simplex-software.fr> wrote:

> Hello,
>
> Thanks for your reply. So, what you're saying is that
> org.apache.camel.dataformat.tarfile.TarElementInputStreamWrapper would be
> an
> input stream, right ? In this case I don't need to convert it, just could
> read from it. But I tried the following:
>
> from("direct:unzip").unmarshal().gzip()
> .split(new TarSplitter())
> .to("file:{{file.unzip.path}}?fileName=${file:name}");
>
> The file-system structure gets correctly created, I mean folders,
> sub-folders, etc., until the file level. But all the files are created with
> 0 blocks, i.e. empty. Do you have any idea of what might happening here ?
>
> Many thanks in advance,
>
> Nicolas
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Trying-to-use-the-TarSplitter-tp5783658p5783722.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


problem Settting camel header value to java enum value

2016-06-08 Thread J-
Trying to set the header to to an enum value but seem like it's only setting it 
to a string using camel 2.17.1:



  ${type:org.apache.camel.Exchange.FILE_NAME}



But the value in the header is a string that equals: 
"org.apache.camel.Exchange.FILE_NAME"


What am i doing wrong??


Also tried with an enum from the simple page:


public enum Customer {
 
GOLD, SILVER, BRONZE
}


  ${type:org.apache.camel.processor.Customer.SILVER}



Thanks.


Camel How to dequeue all messages accumulated every X minutes

2016-06-08 Thread Guls
I am new to Camel. I have a requirement, where I need to dequeue all messages
from an activemq every 5 minutes. 

If I try to introduce a delayer in the route, the very first message is
delayed by 5 minutes and subsequently my dequeuebean is called for every
message once. Suppose if there were 20 message accumulated in 5 minutes, my
dequeuebean is called 20 times with a gap of 5 minutes. 

Delaying messages on activemq using AMQ_SCHEDULED_XXX is not an options; as
this is a third party queue

I cannot predict the number of messages on the queue so I could not use
Throttler. 

How can I dequeue all entities from the queue at once every X minutes. such
that my dequeuebean gets all the message accumulated. 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-How-to-dequeue-all-messages-accumulated-every-X-minutes-tp5783739.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel How to dequeue all messages accumulated every X minutes

2016-06-08 Thread souciance
Have you looked at using quartz to trigger your flow every 5 min?
http://camel.apache.org/quartz2.html

On Thu, Jun 9, 2016 at 8:53 AM, Guls [via Camel] <
ml-node+s465427n5783739...@n5.nabble.com> wrote:

> I am new to Camel. I have a requirement, where I need to dequeue all
> messages from an activemq every 5 minutes.
>
> If I try to introduce a delayer in the route, the very first message is
> delayed by 5 minutes and subsequently my dequeuebean is called for every
> message once. Suppose if there were 20 message accumulated in 5 minutes, my
> dequeuebean is called 20 times with a gap of 5 minutes.
>
> Delaying messages on activemq using AMQ_SCHEDULED_XXX is not an options;
> as this is a third party queue
>
> I cannot predict the number of messages on the queue so I could not use
> Throttler.
>
> How can I dequeue all entities from the queue at once every X minutes.
> such that my dequeuebean gets all the message accumulated.
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-How-to-dequeue-all-messages-accumulated-every-X-minutes-tp5783739.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428...@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-How-to-dequeue-all-messages-accumulated-every-X-minutes-tp5783739p5783741.html
Sent from the Camel - Users mailing list archive at Nabble.com.