Re: using filter inside when?

2013-10-07 Thread Claus Ibsen
Hi

The filter simple predicate is wrong

> .filter(simple("{body[isCredit]} == true"))

See syntax on the simple docs, eg use ${ } as the tokens.

On Tue, Oct 8, 2013 at 8:49 AM, prabumc...@gmail.com
 wrote:
> Hi All,
>
>  I am having added below code in my camel routing,but it not work at all.
>
>  I want to use when and filter both for my routing
>
>   from(ACT_TYPE_SPECFIC_QNAME).choice()
> .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))
>   .filter(simple("{body[isCredit]} == true"))
>  .process(new Processor() {
>   public void process(Exchange exchange) {
> Map map = (Map) exchange.getIn().getBody();
> String Account_No = (String) map.get(ACCOUNT_ID);
> Map newBody = new HashMap();
> newBody.put(ACCOUNT_ID, Account_No);
> exchange.getIn().setBody(newBody);
>}}).to(ACTIVATE_QNAME).endChoice()
>.otherwise()
>.setHeader(DESTINATION, constant(DESTINATION_VALUE))
>.to(EROOR_QNAME)
>.end();
>
> I also added .endChoice()  like you suggest...but ti didn't work pls kindly
> help me.
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/using-filter-inside-when-tp5652300p5741081.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: using filter inside when?

2013-10-07 Thread prabumc...@gmail.com
Hi All,

 I am having added below code in my camel routing,but it not work at all.

 I want to use when and filter both for my routing
 
  from(ACT_TYPE_SPECFIC_QNAME).choice() 
.when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))   
  .filter(simple("{body[isCredit]} == true")) 
 .process(new Processor() { 
  public void process(Exchange exchange) { 
Map map = (Map) exchange.getIn().getBody(); 
String Account_No = (String) map.get(ACCOUNT_ID); 
Map newBody = new HashMap(); 
newBody.put(ACCOUNT_ID, Account_No); 
exchange.getIn().setBody(newBody);  
   
   }}).to(ACTIVATE_QNAME).endChoice() 
   .otherwise() 
   .setHeader(DESTINATION, constant(DESTINATION_VALUE)) 
   .to(EROOR_QNAME) 
   .end(); 

I also added .endChoice()  like you suggest...but ti didn't work pls kindly
help me.





--
View this message in context: 
http://camel.465427.n5.nabble.com/using-filter-inside-when-tp5652300p5741081.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CamelBlueprintTestSupport Issues

2013-10-07 Thread Willem jiang
Hi Andre,

I dug the code few hours ago, I think we should provide a option to include the 
test bundle or not.
Here is the JIRA[1] for it.

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

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, October 8, 2013 at 1:53 PM, Andre Piwoni wrote:

> Willem, thank you for reply. My point is that with CamelBlueprintTestSupport
> that utilizes CamelBlueprintHelper I don't have much control over which
> bundles are included.
>  
> Here's sample Maven project structure that creates bundle (not test bundle)
> and contains test case that extends CamelBlueprintTestSupport:
>  
> ProjectA (bundle)
> - /src/main/resources/OSGI-INF/blueprint/camel-context.xml
> - /src/test/java/TestClassThatExtendsCamelBluePrintTestSupport.java
>  
> public class TestClassThatExtendsCamelBluePrintTestSupport extends
> CamelBlueprintTestSupport {
> ...
> protected String getBlueprintDescriptor() {
> return "OSGI-INF/blueprint/camel-context.xml";
> }
> ...
> }
> When TestClassThatExtendsCamelBluePrintTestSupport is executed
> CamelBlueprintTestSupport calls CamelBlueprintHelper which includes test
> bundle and ProjectA bundle.
>  
> public static BundleContext createBundleContext(String name, String
> descriptors, boolean includeTestBundle,String bundleFilter, String
> testBundleVersion, String testBundleDirectives) throws Exception {
> TinyBundle bundle = null;
>  
> if (includeTestBundle) { // ALWAYS SET TO TRUE BY
> CamelBlueprintTestSupport  
> // add ourselves as a bundle
> bundle = createTestBundle(testBundleDirectives == null ? name :
> name + ';' + testBundleDirectives, testBundleVersion, descriptors);
> }
>  
> return createBundleContext(name, bundleFilter, bundle);
> }
>  
> Here's test bundle inclusion code from createTestBundle():
>  
> TinyBundle bundle = TinyBundles.newBundle();
> for (URL url : getBlueprintDescriptors(descriptors)) {
> LOG.info (http://LOG.info)("Using Blueprint XML file: " + url.getFile());
> bundle.add("OSGI-INF/blueprint/blueprint-" +
> url.getFile().replace("/", "-"), url);
> }
> bundle.set("Manifest-Version", "2")
> .set("Bundle-ManifestVersion", "2")
> .set("Bundle-SymbolicName", name)
> .set("Bundle-Version", version);
> return bundle;
>  
> Here's ProjectA bundle inclusion that comes from scan within
> createBundleContext():
>  
> for (Enumeration e =
> getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");e.hasMoreElements();)
> {
> URL manifestURL = e.nextElement();
> ...
> bundles.add(new BundleDescriptor(getClass().getClassLoader(),
> getParentURL(manifestURL), headers));
> }
>  
> Above results in two bundles with OSGI-INF/blueprint/camel-context.xml and
> I'm not sure how your suggestion would solve this problem? I want to run
> test case but exclude ProjectA bundle.
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/CamelBlueprintTestSupport-Issues-tp5741066p5741074.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





Re: CamelBlueprintTestSupport Issues

2013-10-07 Thread Andre Piwoni
Willem, thank you for reply. My point is that with CamelBlueprintTestSupport
that utilizes CamelBlueprintHelper I don't have much control over which
bundles are included.

Here's sample Maven project structure that creates bundle (not test bundle)
and contains test case that extends CamelBlueprintTestSupport:

ProjectA (bundle)
- /src/main/resources/OSGI-INF/blueprint/camel-context.xml
- /src/test/java/TestClassThatExtendsCamelBluePrintTestSupport.java

public class TestClassThatExtendsCamelBluePrintTestSupport extends
CamelBlueprintTestSupport {
...
protected String getBlueprintDescriptor() {
return "OSGI-INF/blueprint/camel-context.xml";
}
...
}
When TestClassThatExtendsCamelBluePrintTestSupport  is executed
CamelBlueprintTestSupport calls CamelBlueprintHelper which includes test
bundle and ProjectA bundle.

public static BundleContext createBundleContext(String name, String
descriptors, boolean  includeTestBundle,String bundleFilter, String
testBundleVersion, String testBundleDirectives) throws Exception {
TinyBundle bundle = null;

if (includeTestBundle) { // ALWAYS SET TO TRUE BY
CamelBlueprintTestSupport 
// add ourselves as a bundle
bundle = createTestBundle(testBundleDirectives == null ? name :
name + ';' + testBundleDirectives, testBundleVersion, descriptors);
}

return createBundleContext(name, bundleFilter, bundle);
}

Here's test bundle inclusion code from createTestBundle():

TinyBundle bundle = TinyBundles.newBundle();
for (URL url : getBlueprintDescriptors(descriptors)) {
LOG.info("Using Blueprint XML file: " + url.getFile());
bundle.add("OSGI-INF/blueprint/blueprint-" +
url.getFile().replace("/", "-"), url);
}
bundle.set("Manifest-Version", "2")
.set("Bundle-ManifestVersion", "2")
.set("Bundle-SymbolicName", name)
.set("Bundle-Version", version);
return bundle;

Here's ProjectA bundle inclusion that comes from scan within
createBundleContext():

for (Enumeration e =
getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");e.hasMoreElements();)
{
   URL manifestURL = e.nextElement();
...
   bundles.add(new BundleDescriptor(getClass().getClassLoader(),
getParentURL(manifestURL), headers));
}

Above results in two bundles with OSGI-INF/blueprint/camel-context.xml and
I'm not sure how your suggestion would solve this problem? I want to run
test case but exclude ProjectA bundle.




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


Re: Camel JMS redelivery blocks normal processing

2013-10-07 Thread berhack
By the way, I am using Camel 2.11.1 and also in my error handler I made sure
I use asyncDelayedRedelivery.  So everything seems to be in order, yet I
cannot get the redelivery to be fully async



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JMS-redelivery-blocks-normal-processing-tp5741069p5741073.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with mock end points and testing error handling

2013-10-07 Thread kraythe .
Yeah you need to mock and skip and then you need to find the mock endpoint
and attach it using the weaving code. So something like this:

in your advice:
mockEndpointsAndSkip("bean:*");

Then in your test:
final String beanURI = "mock:bean:myBean";
assertNotNull(beanURI); // << DONT FORGET THIS or you will chase ghosts a
lot
MockEndpoint mep = getMockEndpoint(beanURI);

mep.whenAnyExchangeReceived(new Processor() {
  @Override
  process(final Exchange exchange) {
throw RuntimeException("hi");
  }
}

Then send the message to the route.

[1]
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/mock/MockEndpoint.html#whenAnyExchangeReceived(org.apache.camel.Processor)


*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


On Mon, Oct 7, 2013 at 12:17 PM, berhack  wrote:

> I have context level defined error handling (retry interval and retry
> attempts defined) that I am trying to test out.  Yet it will never be
> invoked no matter how I simulate the error with mock end points.  Does
> anyone how this can work?
>
> Given my route I'm testing just looks like:
>
> from(myQueue).to("bean:myBean?method=processOrder")
>
> Here's what I've tried:
>
> Insert advice to skip send to bean endpoint, and send to mock:myBean
> instead.  Have mock:myBean throw an exception.  Error handler is NOT
> invoked
> (I can see no retry attempt at all in the logs).
>
> Override (via Spring injection) the bean endpoint with mock:myBean.  Have
> mock:myBean throw an exception.  Error handler is NOT invoked.
>
> In either above attempts, also tried setting the exception off the Exchange
> object (i.e. exchange.setException), instead of throwing an exception
> explicitly (what's the difference anyway?), again no luck, error handler
> not
> invoked.
>
> Here's what WORKS:
>
> When NO mock end point is involved, i.e. my original bean endpoint throws a
> null pointer exception, I can see error handler working.
>
>
> Any ideas?
>
> Thanks!
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Problem-with-mock-end-points-and-testing-error-handling-tp5741050.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel routing issue

2013-10-07 Thread kraythe .
Filter has to be first in the route. You can probably only put exception
handling and route id before it. The DSL should probably be tighened up for
that.

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


On Mon, Oct 7, 2013 at 12:51 PM, prabumc...@gmail.com
wrote:

> Hi all,
>
> Good morning,
>
> I am trying to use when and filter both in my routing,but it didn't work
>
> I hope it will give you idea what i am trying to achieve
>
> from(ACT_TYPE_SPECFIC_QNAME).choice()
>.when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))
>.filter(simple("{body[isCredit]} == true"))
>.process(new Processor() {
> public void process(Exchange exchange) {
> Map map = (Map) exchange.getIn().getBody();
> String Account_No = (String) map.get(ACCOUNT_ID);
> Map newBody = new HashMap();
> newBody.put(ACCOUNT_ID, Account_No);
> exchange.getIn().setBody(newBody);
>
> }}).to(ACTIVATE_QNAME)
>.endChoice()
>.otherwise()
>.setHeader(DESTINATION, constant(DESTINATION_VALUE))
>.to(EROOR_QNAME)
>.end();
>
> Message reached ACT_TYPE_SPECFIC_QNAME but it only checking when (
> .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) ) condition routing
> message to ACTIVATE_QNAME
>
> Filter not working property in this case.
>
> Please kindly help me
>
>
>
>
> On Wed, Sep 4, 2013 at 11:48 PM, Prabu  wrote:
>
> > Hi All,
> >
> > Camel i having code like this
> >
> > from(MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME).process(new
> > MemosProcess(*getContext().**createProducerTemplate()*))
> > .end();
> >
> > Above code worked fine in activemq 5.5 but after upgrade into active 5.8
> > it is not working.
> >
> > Message getting hang in MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME not
> > calling memosprocess class.
> >
> > Please kindly help me.
> >
> > *Thanks*
> > Prabu.N
> >
> >
> >
> > On Wed, Jul 24, 2013 at 11:49 PM, Christian Mueller [via Camel] <
> > ml-node+s465427n5736234...@n5.nabble.com> wrote:
> >
> >> The test ensure it works:
> >>
> >> @Test
> >> public void testInOnlyJMSExpiration() throws Exception {
> >> MockEndpoint mock = getMockEndpoint("mock:result");
> >> mock.expectedMessageCount(1);
> >>
> >> long ttl = System.currentTimeMillis() + 5000;
> >>
> >> template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=true",
> >> "Hello World", "JMSExpiration", ttl);
> >>
> >> // sleep just a little
> >> Thread.sleep(2000);
> >>
> >> // use timeout in case running on slow box
> >> Exchange bar = consumer.receive("activemq:queue:bar", 1);
> >> assertNotNull("Should be a message on queue", bar);
> >>
> >> template.send("activemq:queue:foo", bar);
> >>
> >> assertMockEndpointsSatisfied();
> >> }
> >>
> >> @Test
> >> public void testInOnlyJMSExpirationNoMessage() throws Exception {
> >> MockEndpoint mock = getMockEndpoint("mock:result");
> >> mock.expectedMessageCount(1);
> >>
> >> long ttl = System.currentTimeMillis() + 2000;
> >>
> >> template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=true",
> >> "Hello World", "JMSExpiration", ttl);
> >>
> >> // sleep more so the message is expired
> >> Thread.sleep(5000);
> >>
> >> Exchange bar = consumer.receiveNoWait("activemq:queue:bar");
> >> assertNull("Should NOT be a message on queue", bar);
> >>
> >> template.sendBody("activemq:queue:foo", "Hello World");
> >>
> >> assertMockEndpointsSatisfied();
> >> }
> >>
> >> protected RouteBuilder createRouteBuilder() throws Exception {
> >> return new RouteBuilder() {
> >> public void configure() throws Exception {
> >> from("activemq:queue:foo")
> >> .to("mock:result");
> >> }
> >> };
> >> }
> >>
> >> Check what you do differently...
> >>
> >> Best,
> >> Christian
> >> -
> >>
> >> Software Integration Specialist
> >>
> >> Apache Camel committer: https://camel.apache.org/team
> >> V.P. Apache Camel: https://www.apache.org/foundation/
> >> Apache Member: https://www.apache.org/foundation/members.html
> >>
> >> https://www.linkedin.com/pub/christian-mueller/11/551/642
> >>
> >>
> >> On Wed, Jul 24, 2013 at 4:42 PM, [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5736234&i=0>
> >> <[hidden email]  >>wrote:
> >>
> >>
> >> > Hi Chris,
> >> >
> >> >  Thanks so much for the information.
> >> >
> >> > I have tried different property but it did not work.
> >> >
> >> > Please find my code below.
> >> >
> >> > *public static final String CONSUMER_TEST_QNAME =
> >> >
> >> >
> >>
> "activemq:queue:ConsumerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
> >>
> >> > *
> >> > *
> >> > *
> >> > *public static final String PRODUCER_TEST_QNAME =
> >> >
> >> >
> >>
> "activemq:queue:ProducerTestHandler?jmsMessageTyp

Re: return binary image data in camel/restlet environment

2013-10-07 Thread Willem jiang
Hi,

Restlet uses the Representation to define the message and mediate type[1].
Camel-Restlet doesn't support the Representation well, and it just try to turn 
the bytes into String as a fall back.
I just fill a JIRA[2] for it and will commit the fix shortly.

You can work around it by changing the message body into an InputStream and set 
Content-Type on the message header.  

[1]http://stackoverflow.com/questions/1509873/serve-dynamic-generated-images-using-restlet
  
[2]https://issues.apache.org/jira/browse/CAMEL-6834
--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, October 8, 2013 at 6:29 AM, Zemin Hu wrote:

> I need to return image from route in restlet environment, if in normal camel
> environment I should be able to do
> byte[] imageData = getImage();
> HttpServletResponse response =
> exchange.getIn().getBody(HttpServletResponse.class);
> response.setContentType("image/png");
> OutputStream os = response.getOutputStream();
> os.write(imageData);
> os.close();
> Now, in restlet environment, the response is null. I am doing:
> exchange.getOut().setBody(imageData);
> While it executed correctly, the data is encoded and inflated(about 30-40%
> more), the header is set to:
> Content-Type: text/plain;charset=UTF-8
> if I don't set "Content-Type", but even I set it to original type:
> "image/png", the header will be
> Content-Type: image/pgn;charset=UTF-8
> The returning binary data is still inflated and encoded.  
> Is there any way to prevent this to happen? I guess my another question
> would be:
> How do I get HttpServletResponse or OutputStream for response in restlet
> environment so I can simply set up and output my binary data as in normal
> servlet environment? Where is it hidden(I tried to find it under debugging
> environment but could not find it)?
> Thanks.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/return-binary-image-data-in-camel-restlet-environment-tp5741062.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





Re: dynamicly change the url of the element after the camelcontext is started

2013-10-07 Thread salemi
Thank you Babak. It had to overwrite the following methods in order for
Spring and Camel to work.


public class MyBridgePropertyPlaceholderConfigurer extends
BridgePropertyPlaceholderConfigurer{

@Override   
protected String resolvePlaceholder(String placeholder, Properties 
props,
int systemPropertiesMode){..}
@Override
public Properties resolveProperties(CamelContext context, boolean
ignoreMissingLocation, String... uri){}

}

Ali



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/dynamicly-change-the-url-of-the-from-element-after-the-camelcontext-is-started-tp5740599p5741057.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel JMS redelivery blocks normal processing

2013-10-07 Thread berhack
Hi all,

Does anyone know how to properly implement redelivery that does not block
normal processing of other messages?

I have an error handler defined with DLQ, but once that kicks in, no
messages will be consumed.

I know about asyncConsumer, I set it on the JmsConfiguration but to no
avail.  Once it starts the retry/redelivery, nothing else is coming through!

I only got this to work if you up the concurrent consumers to say, 2, but
that's not what I'm looking for, since then it just delays the inevitable by
increasing the failure capacity to 2, then it will block again.

As an experiment, I set both options (asyncConsumer=true,
maxConcurrentConsumers=2) and got unexpected results - my problem message
was being processed twice...

I notice that during redelivery, the problem message is not dequeued, and
maybe that is the problem.  Even if asyncConsumer = true, it keeps retrying
the same message over and over?  If that is the case, how do you get the JMS
consumer to dequeue during retry?

Any input would be appreciated.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JMS-redelivery-blocks-normal-processing-tp5741069.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: two camel instances and jms failover on a topic

2013-10-07 Thread Willem jiang
Please don't send the question across the mailing list.
Here is the the answer[1] to activemq user mailing list.


[1]http://activemq.2283324.n4.nabble.com/How-to-implement-two-consumers-on-a-topic-Camel-One-of-consumers-is-inactive-until-the-active-one-fa-td4672355.html

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, October 8, 2013 at 6:12 AM, salemi wrote:

> Hi All,
>  
> I like to start two instances of camel. Both of them have a  element
> that connects to a jms topic. I like one of the Camel connections to be
> active at the time and if one of them fails the other camel instance will
> take it over.
>  
> How would you implement this in Camel?
>  
> Thanks,
> Ali
>  
>  
>  
> -
> Alireza Salemi
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/two-camel-instances-and-jms-failover-on-a-topic-tp5741060.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).
>  





Re: CamelBlueprintTestSupport Issues

2013-10-07 Thread Willem jiang
Hi,

CamelBlueprintHelper just creates one test bundle and it will look up the 
bundles in the class path to install them.
I suggest you to massage your class path to exclude the test classes bundle or 
you just put the test into your test classes bundle.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, October 8, 2013 at 8:43 AM, Andre Piwoni wrote:

> Within a maven project that creates bundle I have a test class that extends
> CamelBlueprintTestSupport with blueprint descriptor under OSGI-INF/blueprint
> directory.
> It seems that CamelBlueprintHelper creates two bundles that point to the
> same Blueprint XML.
>  
> One bundle is created for Bundle-SymbolicName=testClassName using blueprint
> under OSGI-INF/blueprint directory and another is created by scanning for
> bundles in all META-INF/MANIFEST.MF resources, one of these bundles happens
> to be a bundle for project containing test class and pointing to the same
> Blueprint XML.
>  
> This seems to be causing all sorts of issues and I was wondering how to
> handle this problem.
>  
> Thanks,
> Andre
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/CamelBlueprintTestSupport-Issues-tp5741066.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





two camel instances and jms failover on a topic

2013-10-07 Thread salemi
Hi All,

I like to start two instances of camel. Both of them have a  element
that connects to a jms topic. I like one of the Camel connections to be
active at the time and if one of them fails the other camel instance will
take it over.

How would you implement this in Camel?

Thanks,
Ali



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/two-camel-instances-and-jms-failover-on-a-topic-tp5741060.html
Sent from the Camel - Users mailing list archive at Nabble.com.


CamelBlueprintTestSupport Issues

2013-10-07 Thread Andre Piwoni
Within a maven project that creates bundle I have a test class that extends
CamelBlueprintTestSupport with blueprint descriptor under OSGI-INF/blueprint
directory.
It seems that CamelBlueprintHelper creates two bundles that point to the
same Blueprint XML.

One bundle is created for Bundle-SymbolicName=testClassName using blueprint
under OSGI-INF/blueprint directory and another is created by scanning for
bundles in all META-INF/MANIFEST.MF resources, one of these bundles happens
to be a bundle for project containing test class and pointing to the same
Blueprint XML.

This seems to be causing all sorts of issues and I was wondering how to
handle this problem.

Thanks,
Andre




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


return binary image data in camel/restlet environment

2013-10-07 Thread Zemin Hu
I need to return image from route in restlet environment, if in normal camel
environment I should be able to do
   byte[] imageData = getImage();
   HttpServletResponse response =
exchange.getIn().getBody(HttpServletResponse.class);
   response.setContentType("image/png");
   OutputStream os = response.getOutputStream();
   os.write(imageData);
   os.close();
Now, in restlet environment, the response is null. I am doing:
   exchange.getOut().setBody(imageData);
While it executed correctly, the data is encoded and inflated(about 30-40%
more), the header is set to:
   Content-Type: text/plain;charset=UTF-8
if I don't set "Content-Type", but even I set it to original type:
"image/png", the header will be
   Content-Type: image/pgn;charset=UTF-8
The returning binary data is still inflated and encoded. 
Is there any way to prevent this to happen? I guess my another question
would be:
How do I get HttpServletResponse or OutputStream for response in restlet
environment so I can simply set up and output my binary data as in normal
servlet environment? Where is it hidden(I tried to find it under debugging
environment but could not find it)?
Thanks.



--
View this message in context: 
http://camel.465427.n5.nabble.com/return-binary-image-data-in-camel-restlet-environment-tp5741062.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Throttling by client ID?

2013-10-07 Thread Daniel Bularzik
So obviously, instead of asking "Is there a way..." I should have asked "How do 
I..."

Consider this a restatement of my original question. How would I go about doing 
this? A summary of a whiteboard implementation would be sufficient.


-Original Message-
From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On 
Behalf Of James Carman
Sent: Monday, October 07, 2013 8:08 AM
To: users@camel.apache.org
Subject: Re: Throttling by client ID?

I actually had to implement that on a whiteboard when interviewing for a 
certain tech company.  It's not terribly difficult to implement such a beast.


On Mon, Oct 7, 2013 at 7:59 AM, Daniel Bularzik  wrote:

>  We're looking to enforce a per-client SLA; notably, right now we're 
> considering how to throttle service use on a per-client basis. I've 
> found the Throttler Pattern, but this appears to only useful for 
> throttling overall use of the service. Is there a way to use Throttler 
> to limit access on a per-client basis? Assume the client ID is 
> available in the exchange.*
> ***
>
> ** **
>
> Daniel Bularzik, Lead Software Engineer
>
> 8051 Arco Corporate Drive, Suite 100, Raleigh, NC 27617
>
> 919-816-3818, d...@akc.org
>
> www.akc.org   Facebook 
> Twitter 
>
> ** **
>


Re: AW: AW: Camel Routing using map message help required

2013-10-07 Thread Robert Simmons
Filter has to be first in the route.

Sent from my iPad

> On Oct 7, 2013, at 12:14 PM, "prabumc...@gmail.com"  
> wrote:
> 
> Sorry i have copied full code here
> 
> I hope it will give you idea what i am trying to achieve 
> 
> from(ACT_TYPE_SPECFIC_QNAME).choice()
>   .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))   
>   .filter(simple("{body[isCredit]} == true"))
>   .process(new Processor() {
>public void process(Exchange exchange) {
>Map map = (Map) exchange.getIn().getBody();
>String Account_No = (String) map.get(ACCOUNT_ID);
>Map newBody = new HashMap(); 
>newBody.put(ACCOUNT_ID, Account_No); 
>exchange.getIn().setBody(newBody); 
>
>}}).to(ACTIVATE_QNAME)
>   .endChoice()
>   .otherwise()
>   .setHeader(DESTINATION, constant(DESTINATION_VALUE))
>   .to(EROOR_QNAME)
>   .end();
> 
> Message reached ACT_TYPE_SPECFIC_QNAME but it only checking when (
> .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) )
> condition routing message to ACTIVATE_QNAME
> 
> Filter not working property in this case.
> 
> Please kindly help me
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741049.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel routing issue

2013-10-07 Thread prabumc...@gmail.com
Hi all,

Good morning,

I am trying to use when and filter both in my routing,but it didn't work

I hope it will give you idea what i am trying to achieve

from(ACT_TYPE_SPECFIC_QNAME).choice()
   .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))
   .filter(simple("{body[isCredit]} == true"))
   .process(new Processor() {
public void process(Exchange exchange) {
Map map = (Map) exchange.getIn().getBody();
String Account_No = (String) map.get(ACCOUNT_ID);
Map newBody = new HashMap();
newBody.put(ACCOUNT_ID, Account_No);
exchange.getIn().setBody(newBody);

}}).to(ACTIVATE_QNAME)
   .endChoice()
   .otherwise()
   .setHeader(DESTINATION, constant(DESTINATION_VALUE))
   .to(EROOR_QNAME)
   .end();

Message reached ACT_TYPE_SPECFIC_QNAME but it only checking when (
.when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) ) condition routing
message to ACTIVATE_QNAME

Filter not working property in this case.

Please kindly help me




On Wed, Sep 4, 2013 at 11:48 PM, Prabu  wrote:

> Hi All,
>
> Camel i having code like this
>
> from(MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME).process(new
> MemosProcess(*getContext().**createProducerTemplate()*))
> .end();
>
> Above code worked fine in activemq 5.5 but after upgrade into active 5.8
> it is not working.
>
> Message getting hang in MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME not
> calling memosprocess class.
>
> Please kindly help me.
>
> *Thanks*
> Prabu.N
>
>
>
> On Wed, Jul 24, 2013 at 11:49 PM, Christian Mueller [via Camel] <
> ml-node+s465427n5736234...@n5.nabble.com> wrote:
>
>> The test ensure it works:
>>
>> @Test
>> public void testInOnlyJMSExpiration() throws Exception {
>> MockEndpoint mock = getMockEndpoint("mock:result");
>> mock.expectedMessageCount(1);
>>
>> long ttl = System.currentTimeMillis() + 5000;
>>
>> template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=true",
>> "Hello World", "JMSExpiration", ttl);
>>
>> // sleep just a little
>> Thread.sleep(2000);
>>
>> // use timeout in case running on slow box
>> Exchange bar = consumer.receive("activemq:queue:bar", 1);
>> assertNotNull("Should be a message on queue", bar);
>>
>> template.send("activemq:queue:foo", bar);
>>
>> assertMockEndpointsSatisfied();
>> }
>>
>> @Test
>> public void testInOnlyJMSExpirationNoMessage() throws Exception {
>> MockEndpoint mock = getMockEndpoint("mock:result");
>> mock.expectedMessageCount(1);
>>
>> long ttl = System.currentTimeMillis() + 2000;
>>
>> template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=true",
>> "Hello World", "JMSExpiration", ttl);
>>
>> // sleep more so the message is expired
>> Thread.sleep(5000);
>>
>> Exchange bar = consumer.receiveNoWait("activemq:queue:bar");
>> assertNull("Should NOT be a message on queue", bar);
>>
>> template.sendBody("activemq:queue:foo", "Hello World");
>>
>> assertMockEndpointsSatisfied();
>> }
>>
>> protected RouteBuilder createRouteBuilder() throws Exception {
>> return new RouteBuilder() {
>> public void configure() throws Exception {
>> from("activemq:queue:foo")
>> .to("mock:result");
>> }
>> };
>> }
>>
>> Check what you do differently...
>>
>> Best,
>> Christian
>> -
>>
>> Software Integration Specialist
>>
>> Apache Camel committer: https://camel.apache.org/team
>> V.P. Apache Camel: https://www.apache.org/foundation/
>> Apache Member: https://www.apache.org/foundation/members.html
>>
>> https://www.linkedin.com/pub/christian-mueller/11/551/642
>>
>>
>> On Wed, Jul 24, 2013 at 4:42 PM, [hidden 
>> email]
>> <[hidden email] >wrote:
>>
>>
>> > Hi Chris,
>> >
>> >  Thanks so much for the information.
>> >
>> > I have tried different property but it did not work.
>> >
>> > Please find my code below.
>> >
>> > *public static final String CONSUMER_TEST_QNAME =
>> >
>> >
>> "activemq:queue:ConsumerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
>>
>> > *
>> > *
>> > *
>> > *public static final String PRODUCER_TEST_QNAME =
>> >
>> >
>> "activemq:queue:ProducerTestHandler?jmsMessageType=Text&preserveMessageQos=true";
>>
>> > *
>> > **
>> > *public static final String MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME
>>  =
>> > "activemq:queue:Inbound.Memos.Consumer.Test";*
>> > *
>> > *
>> > *public static final String MESSAGING_TEST_PRODUCER_TYPE_SPECIFIC_QNAME
>>  =
>> > "activemq:queue:Inbound.Memos.Producer.Test";*
>> >
>> >
>> > from(*MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME*).process(new
>> Processor()
>> > {
>> >  public void process(Exchange exchange) throws Exception {
>> >
>> >  }
>> >  .setHeader(MEMOS_TARGET_SERVER,header(MASTER_HANDLER))
>> >  .setHeader(JMSExpiration,constant(EXPIRY_TIME))
>> >  .to(CONSUMER_TEST_QNAME)
>> >  

Problem with mock end points and testing error handling

2013-10-07 Thread berhack
I have context level defined error handling (retry interval and retry
attempts defined) that I am trying to test out.  Yet it will never be
invoked no matter how I simulate the error with mock end points.  Does
anyone how this can work?

Given my route I'm testing just looks like:

from(myQueue).to("bean:myBean?method=processOrder")

Here's what I've tried:

Insert advice to skip send to bean endpoint, and send to mock:myBean
instead.  Have mock:myBean throw an exception.  Error handler is NOT invoked
(I can see no retry attempt at all in the logs).

Override (via Spring injection) the bean endpoint with mock:myBean.  Have
mock:myBean throw an exception.  Error handler is NOT invoked.

In either above attempts, also tried setting the exception off the Exchange
object (i.e. exchange.setException), instead of throwing an exception
explicitly (what's the difference anyway?), again no luck, error handler not
invoked.

Here's what WORKS:

When NO mock end point is involved, i.e. my original bean endpoint throws a
null pointer exception, I can see error handler working.


Any ideas?

Thanks! 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-mock-end-points-and-testing-error-handling-tp5741050.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: AW: Camel Routing using map message help required

2013-10-07 Thread prabumc...@gmail.com
Sorry i have copied full code here

I hope it will give you idea what i am trying to achieve 

from(ACT_TYPE_SPECFIC_QNAME).choice()
   .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION))   
   .filter(simple("{body[isCredit]} == true"))
   .process(new Processor() {
public void process(Exchange exchange) {
Map map = (Map) exchange.getIn().getBody();
String Account_No = (String) map.get(ACCOUNT_ID);
Map newBody = new HashMap(); 
newBody.put(ACCOUNT_ID, Account_No); 
exchange.getIn().setBody(newBody);  
  
}}).to(ACTIVATE_QNAME)
   .endChoice()
   .otherwise()
   .setHeader(DESTINATION, constant(DESTINATION_VALUE))
   .to(EROOR_QNAME)
   .end();
   
Message reached ACT_TYPE_SPECFIC_QNAME but it only checking when (
.when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) )
condition routing message to ACTIVATE_QNAME

Filter not working property in this case.

Please kindly help me




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741049.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: AW: Camel Routing using map message help required

2013-10-07 Thread prabumc...@gmail.com
i want use filter not when



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741047.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: AW: Camel Routing using map message help required

2013-10-07 Thread kraythe .
Ack ... premature submit ... check out the content based router EIP.

http://camel.apache.org/enterprise-integration-patterns.html

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


On Mon, Oct 7, 2013 at 11:45 AM, kraythe .  wrote:

> choice()
> .when(simple("${body[CREDITORDEBIT]} == true").to(credit_uri).endChoice()
> .otherwise().to(debit_uri)
> .end()
>
> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
> *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*
>
>
> On Mon, Oct 7, 2013 at 8:45 AM, prabumc...@gmail.com  > wrote:
>
>> My message is mapmessage.
>>
>> I.e my map message contain key CREDITORDEBIT.I want check if it is credit
>> i
>> want move message or i want discard the message
>>
>> I have added following code,But this didn't work.
>>
>> .filter(property(CREDITORDEBIT).isEqualTo(CREDIT))
>>
>>
>> Please kindly help me.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741033.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>


Re: AW: AW: Camel Routing using map message help required

2013-10-07 Thread kraythe .
choice()
.when(simple("${body[CREDITORDEBIT]} == true").to(credit_uri).endChoice()
.otherwise().to(debit_uri)
.end()

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


On Mon, Oct 7, 2013 at 8:45 AM, prabumc...@gmail.com
wrote:

> My message is mapmessage.
>
> I.e my map message contain key CREDITORDEBIT.I want check if it is credit i
> want move message or i want discard the message
>
> I have added following code,But this didn't work.
>
> .filter(property(CREDITORDEBIT).isEqualTo(CREDIT))
>
>
> Please kindly help me.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741033.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: How to programmatically find next downstream endpoint in a route.

2013-10-07 Thread James Carman
The next step in the route may not be an endpoint, so it's not
"addressable" in that way.

On Mon, Oct 7, 2013 at 12:02 PM, Chris  wrote:
> James, thanks for the suggestion - I'll try that, however, I would still
> like to know if/how a given endpoint can programmtically find the next
> down-stream endpoint in a route...
>
>
> On 10/4/2013 1:38 PM, James Carman wrote:
>>
>> Does a splitter not work for you in this case?
>>
>> On Fri, Oct 4, 2013 at 1:28 PM, Chris  wrote:
>>>
>>> Hello,
>>>
>>> I implemented a bean whose method accepts an exchange with a single
>>> message,
>>> then generates multiple messages intended for the next endpoint
>>> down-stream,
>>> along the lines of this:
>>>
>>>
>>> http://camel.apache.org/how-do-i-write-a-custom-processor-which-sends-multiple-messages.html
>>>
>>>
>>> However, I'd like to avoid having to explicitly configure the endpoint in
>>> the bean's ProducerTemplate if it can be found in the route definition.
>>>
>>> In other words, if I have:
>>>
>>> from("direct:start")
>>> .enrich("bean:MyBean")
>>> .to("mock:result");  <<< this should be sufficient to indicate producer
>>> target URI.
>>>
>>> ...and MyBean is:
>>>
>>> public MyBean {
>>>protected ProducerTemplate producer;
>>>public void businessLogic(Exchange exchange) {
>>>if (producer == null) {
>>>producer = exchange.createProducerTemplate();
>>>producer.setDefaultEndpointUri("mock:result"); <<< Why should
>>> I
>>> have to do this?  I just want it to go to the next down-stream endpoint
>>> in
>>> the pipeline, already defined in the route!!
>>>}
>>>[...bla, bla, bla...]
>>>while (hasStuffToSend) {
>>>producer.setBody(stuff[i]);
>>>}
>>>}
>>> }
>>>
>>>
>


Is there any way to parameterize a JPQL query when using the JPA component in consumer mode?

2013-10-07 Thread Chris
The only think I see is "consumer.parameters" - but that's for release 
2.12 and I would need to regression-test a lot of stuff to upgrade at 
this point.  Any other way?


Re: How to programmatically find next downstream endpoint in a route.

2013-10-07 Thread Chris
James, thanks for the suggestion - I'll try that, however, I would still 
like to know if/how a given endpoint can programmtically find the next 
down-stream endpoint in a route...


On 10/4/2013 1:38 PM, James Carman wrote:

Does a splitter not work for you in this case?

On Fri, Oct 4, 2013 at 1:28 PM, Chris  wrote:

Hello,

I implemented a bean whose method accepts an exchange with a single message,
then generates multiple messages intended for the next endpoint down-stream,
along the lines of this:

http://camel.apache.org/how-do-i-write-a-custom-processor-which-sends-multiple-messages.html


However, I'd like to avoid having to explicitly configure the endpoint in
the bean's ProducerTemplate if it can be found in the route definition.

In other words, if I have:

from("direct:start")
.enrich("bean:MyBean")
.to("mock:result");  <<< this should be sufficient to indicate producer
target URI.

...and MyBean is:

public MyBean {
   protected ProducerTemplate producer;
   public void businessLogic(Exchange exchange) {
   if (producer == null) {
   producer = exchange.createProducerTemplate();
   producer.setDefaultEndpointUri("mock:result"); <<< Why should I
have to do this?  I just want it to go to the next down-stream endpoint in
the pipeline, already defined in the route!!
   }
   [...bla, bla, bla...]
   while (hasStuffToSend) {
   producer.setBody(stuff[i]);
   }
   }
}




Re: AW: AW: Camel Routing using map message help required

2013-10-07 Thread prabumc...@gmail.com
My message is mapmessage.

I.e my map message contain key CREDITORDEBIT.I want check if it is credit i
want move message or i want discard the message 

I have added following code,But this didn't work.

.filter(property(CREDITORDEBIT).isEqualTo(CREDIT))


Please kindly help me.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Routing-using-map-message-help-required-tp5740305p5741033.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Throttling by client ID?

2013-10-07 Thread James Carman
I actually had to implement that on a whiteboard when interviewing for a
certain tech company.  It's not terribly difficult to implement such a
beast.


On Mon, Oct 7, 2013 at 7:59 AM, Daniel Bularzik  wrote:

>  We’re looking to enforce a per-client SLA; notably, right now we’re
> considering how to throttle service use on a per-client basis. I’ve found
> the Throttler Pattern, but this appears to only useful for throttling
> overall use of the service. Is there a way to use Throttler to limit access
> on a per-client basis? Assume the client ID is available in the exchange.*
> ***
>
> ** **
>
> Daniel Bularzik, Lead Software Engineer
>
> 8051 Arco Corporate Drive, Suite 100, Raleigh, NC 27617
>
> 919-816-3818, d...@akc.org
>
> www.akc.org   Facebook 
> Twitter 
>
> ** **
>


Camel Quartz2 Clustering fails due to durable jobs, has anyone got

2013-10-07 Thread Mark Richards - News Systems and Architecture
Hi,

I’m using Camel 2.12.1, Quartz 2.2.0, Blueprint and Mysql 5.5 in Karaf 2.3.1 
and attempting to use clustering, without any success :-(



My aim is to run multiple VMs that will load balance Quartz camel routes and 
fail over should one stop (losing the odd job schedule isn't too important, but 
being down for more than 5-10 minutes would be unacceptable; so clustering 
seems a logical solution. :-)



Steps:

- When I build and start the first Karaf in a Linux VM... it will start Quartz2 
and begin triggering jobs.

- When I copy the Karaf build into another VM and start Karaf (both connecting 
to the same db) I get complaints about Job durability.

- If I restart the first Karaf; it no longer works with Quartz2, also 
complaining about Job Durability.



So, I'd really appreciate any help or experience anyone has with this; I'm 
hoping I'm not the first to run Camel Quartz2 clusters and if anyone has an 
example set of quartz 2 properties and a camel route that works in Blueprint, 
perhaps Spring (although trying to avoid going Spring heavy); that'd be great!



Alternatively, it there's a way to wire it in in Java DSL, I can give that a go 
if there's a way to hook the Camel context in from the Blueprint somehow!?



My setup is below! Would really appreciate some help on this; Camel and Quartz 
seem like a great fit! :-)

The properties seem to work fine if I use Quartz without Camel (Example 13 in 
Quartz 2 documentation).



Thanks

Mark



I have a blueprint including the following:

  



  

  

  



  

  



  



But get the error:

Failed to create route route1: 
Route(route1)[[From[quartz2://examples/example?job.name=tes... because of 
Failed to resolve endpoint: 
quartz2://examples/example?cron=0%2F10+*+*+*+*+%3F&deleteJob=false&job.name=test1&stateful=true
 due to: Jobs added with no trigger must be durable.

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
endpoint: 
quartz2://examples/example?cron=0%2F10+*+*+*+*+%3F&deleteJob=false&job.name=test1&stateful=true
 due to: Jobs added with no trigger must be durable.

Caused by: org.quartz.SchedulerException: Jobs added with no trigger must be 
durable.







Quartz properties:

org.quartz.scheduler.instanceName: TestScheduler

org.quartz.scheduler.skipUpdateCheck: true

org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool

org.quartz.threadPool.threadCount: 5

org.quartz.threadPool.threadPriority: 5

org.quartz.jobStore.misfireThreshold: 6

org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX

org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate

org.quartz.jobStore.dataSource=myDS

org.quartz.jobStore.tablePrefix=QRTZ_

org.quartz.jobStore.isClustered=true

org.quartz.dataSource.myDS.driver: com.mysql.jdbc.Driver

org.quartz.dataSource.myDS.URL: jdbc:mysql://windowshost:3306/quartz

org.quartz.dataSource.myDS.user: root

org.quartz.dataSource.myDS.password: password

org.quartz.dataSource.myDS.maxConnections: 8

org.quartz.dataSource.myDS.validationQuery: select 0



Using a feature like:



  mvn:org.apache.camel/camel-core/${camel.version}/jar

  mvn:org.apache.camel/camel-blueprint/${camel.version}/jar

  mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.c3p0/${c3p0.version}/jar

  mvn:org.apache.camel/camel-quartz2/${camel.version}/jar

  mvn:org.quartz-scheduler/quartz/${quartz2.version}/jar

  mvn:mysql/mysql-connector-java/${mysql.version}/jar

  mvn:example/osgi-fragment-c3p0-mysql/${project.version}/jar
 <- fragment bundle imports Mysql driver package into C3P0 bundle








http://www.bbc.co.uk
This e-mail (and any attachments) is confidential and may contain personal 
views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on 
it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.

-


Throttling by client ID?

2013-10-07 Thread Daniel Bularzik
We're looking to enforce a per-client SLA; notably, right now we're considering 
how to throttle service use on a per-client basis. I've found the Throttler 
Pattern, but this appears to only useful for throttling overall use of the 
service. Is there a way to use Throttler to limit access on a per-client basis? 
Assume the client ID is available in the exchange.

Daniel Bularzik, Lead Software Engineer
[cid:image003.jpg@01CEC333.25B461D0]8051 Arco Corporate Drive, Suite 100, 
Raleigh, NC 27617
919-816-3818, d...@akc.org
www.akc.org   
Facebook   
Twitter



Setting the flag non identifying job parameter in Camel route header with camel-spring-batch

2013-10-07 Thread nguyen
Hi all,

I'm using camel-spring batch 2.10.3 and integrate with spring batch core
2.2.0. 
In spring batch 2.2.0, it supports the option of non-identifying job
parameters, and I need to modify some of the job parameters to be
non-identifying.

Currently, all the headers found in the Camel message are passed to the
JobLauncher as job parameters, and by default, they are "identifying" job
parameter.

I read the Camel documentation for the spring batch, but can not figure out
if there's an option for me to set the flag identifying(false) job parameter
to the Job Launcher.

Or do i need to remove these headers from my camel route and implement some
other solution in the batch job.

Any help, suggestion is really appreciated.

Best Regards,

Below is my route definition : 
For example, if fileExpectedLineCount or fileActualLineCount are set to be
non identifying job parameters.

http://camel.apache.org/schema/spring";>
  


${headers.CamelFileNameOnly}





${headers.lineMetaData.expectedLineCount}


${headers.lineMetaData.actualLineCount}




--
View this message in context: 
http://camel.465427.n5.nabble.com/Setting-the-flag-non-identifying-job-parameter-in-Camel-route-header-with-camel-spring-batch-tp5741018.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Testing DSL based on Apache Camel

2013-10-07 Thread David MacDonald
Yeah the name can be a bit confusing, especially with regards to unit testing
but it's the closest to a 'unit' that we can achieve with certain service
buses...

You can also test asynchronous services i.e. if we have a message
canonicalizer that takes a target-system message off a JMS destination and
transforms it to a canonical format for broadcast onto another JMS
destination then we can run the following test:





--
View this message in context: 
http://camel.465427.n5.nabble.com/Testing-DSL-based-on-Apache-Camel-tp5740992p5741019.html
Sent from the Camel - Users mailing list archive at Nabble.com.