RE: [External] Re: Looking for a transactional solution

2021-04-09 Thread Brenneis, Steve
Hi George.

It appears that when we use the embedded ActiveMQ server, i.e. the vm protocol, 
it will not negotiate a transaction with IBM MQ. The standalone ActiveMQ broker 
seems to work.

Thank you for your help.

-Original Message-
From: George Daswani 
Sent: Thursday, April 8, 2021 11:39 PM
To: users@camel.apache.org
Subject: Re: [External] Re: Looking for a transactional solution



WARNING: This message was received from an EXTERNAL EMAIL ADDRESS.
 Examine the URL and use caution BEFORE clicking links or opening any 
attachments.
Hello Steve,

  It seems to work for me, let me know if you want to see a sample
maven project for it.   Are you sure that your "jms" component is
configured correctly and has a transactionManager set and has transacted = true?


   

The sample project I created has a scheduled route that writes to the INPUT 
queue the current date and time every 10 seconds.  There's a route that reads 
from the queue wrapped in a transaction (propagation_requires_new), has a 
processor that displays the message on the log, then calls another route 
wrapped in a transaction (propagation_required) which writes to an outgoing 
queue.  At the end of the second route, it checks to see if the date/time 
written ends with "30" and if so, throws an exception (which will roll back the 
write to the outgoing queue, bubbling up to the reading
queue).   The TransactionErrorHandler (as long as there's no redeliveries
set on the camel side) automatically rolled back the transaction and the 
message broker automatically redelivers it.

Just a caveat though, some message brokers (e.q. I used ActiveMQ with the
"jms" component) defines a default edelivery policy.   ActiveMQ for example
only redeliveries up to six times if you don't override it with 
"jms.redeliveryPolicy.maximumRedeliveries" URL connection property.


On Thu, Apr 8, 2021 at 9:27 AM Brenneis, Steve < 
steve.brenn...@theclearinghouse.org> wrote:

> Thank you for your answer George.
>
> We are using the XML DSL. When we try something like this:
>
> 
>   
>   
> 
>
> 
>   
>   
>   
> 
>
> 
>   
>   
>   
>   https://clicktime.symantec.com/3NL8rtk3CaQa9bJreF5FDn7Vc?u=https%3A%2F
> %2Fcamel.apache.org%2Fcomponents%2F3.4.x%2Feips%2Ftransactional-client
> .html
>
> For example.
>
>  class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>  ref="jmsTransactionManager"/>
>  class="org.apache.camel.spring.spi.SpringTransactionPolicy">
> 
>  value="PROPAGATION_REQUIRES_NEW"/>
>
>
>
> from("readFromQueue").transacted("PROPAGATION_REQUIRES_NEW").to("direc
> t:doSomeProcessing").to("writeToQ");
>
> from("doSomeProcessing").transacted("PROPAGATION_REQUIRED");
>
> from("writeToQ").transacted(PROPAGATION_REQUIRED");
>
>
>
>
>
> On Wed, Apr 7, 2021 at 12:28 PM Brenneis, Steve <
> steve.brenn...@theclearinghouse.org> wrote:
>
> > I hope this is the right place to ask this question. If not, maybe
> > someone can direct me to the right place.
> >
> > I have an application that reads messages from a queue, passes them
> > off to a content-based router, which then passes them to various
> > validation and transformation routes. At the end of each series of
> > routes the transformed, validated messages are placed onto another queue.
> >
> > The problem to be solved is that the messages must be delivered once
> > and only once to the outgoing queue. The solution to this would seem
> > to be a queue-to-queue XA transaction, but I can't find anything
> > that indicates that a transaction could cross route boundaries.
> >
> > Is there such a solution available? Thanks for any help with this.
> >
> > Steve Brenneis
> >
> > This e-mail may contain information that is privileged or
> > confidential. If you are not the intended recipient, please delete
> > the e-mail and notify us immediately.
> >
> This e-mail may contain information that is privileged or
> confidential. If you are not the intended recipient, please delete the
> e-mail and notify us immediately.
>
This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and notify us 
immediately.


RE: [External] Re: Looking for a transactional solution

2021-04-08 Thread Brenneis, Steve
Thank you for your answer George.

We are using the XML DSL. When we try something like this:


  
  



  
  
  



  
  
  
  https://clicktime.symantec.com/3NL8rtk3CaQa9bJreF5FDn7Vc?u=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.4.x%2Feips%2Ftransactional-client.html

For example.








from("readFromQueue").transacted("PROPAGATION_REQUIRES_NEW").to("direct:doSomeProcessing").to("writeToQ");

from("doSomeProcessing").transacted("PROPAGATION_REQUIRED");

from("writeToQ").transacted(PROPAGATION_REQUIRED");





On Wed, Apr 7, 2021 at 12:28 PM Brenneis, Steve < 
steve.brenn...@theclearinghouse.org> wrote:

> I hope this is the right place to ask this question. If not, maybe
> someone can direct me to the right place.
>
> I have an application that reads messages from a queue, passes them
> off to a content-based router, which then passes them to various
> validation and transformation routes. At the end of each series of
> routes the transformed, validated messages are placed onto another queue.
>
> The problem to be solved is that the messages must be delivered once
> and only once to the outgoing queue. The solution to this would seem
> to be a queue-to-queue XA transaction, but I can't find anything that
> indicates that a transaction could cross route boundaries.
>
> Is there such a solution available? Thanks for any help with this.
>
> Steve Brenneis
>
> This e-mail may contain information that is privileged or
> confidential. If you are not the intended recipient, please delete the
> e-mail and notify us immediately.
>
This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and notify us 
immediately.


Looking for a transactional solution

2021-04-07 Thread Brenneis, Steve
I hope this is the right place to ask this question. If not, maybe someone can 
direct me to the right place.

I have an application that reads messages from a queue, passes them off to a 
content-based router, which then passes them to various validation and 
transformation routes. At the end of each series of routes the transformed, 
validated messages are placed onto another queue.

The problem to be solved is that the messages must be delivered once and only 
once to the outgoing queue. The solution to this would seem to be a 
queue-to-queue XA transaction, but I can't find anything that indicates that a 
transaction could cross route boundaries.

Is there such a solution available? Thanks for any help with this.

Steve Brenneis

This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and notify us 
immediately.


Bindy problem

2021-02-24 Thread Brenneis, Steve
I am using camel-bindy version 3.8.0 and I'm hitting a null pointer exception 
because bindy selects the key-value pair format and ignores the annotated 
format type and XML-defined format when the model class is annotated with the 
Spring @Value annotation or if the XML bean definition contains property 
elements.



Model class:



@FixedLengthRecord(length=103)

public class MyModelClass {



@DataField(pos = 1, length = 2)

private String constantField;



@DataField(pos = 3, length = 5)

private String variableField;



...

Constructor and getters/setters



}



XML model bean definition





 



XML bindy route



















Exception



java.lang.NullPointerException: null

at 
org.apache.camel.dataformat.bindy.util.ConverterUtils.getByteReturn(ConverterUtils.java:46)

at 
org.apache.camel.dataformat.bindy.kvp.BindyKeyValuePairDataFormat.marshal(BindyKeyValuePairDataFormat.java:72)

at 
org.apache.camel.support.processor.MarshalProcessor.process(MarshalProcessor.java:64)

at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395)

at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)

at 
org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)

at 
org.apache.camel.processor.Pipeline.process(Pipeline.java:147)

at 
org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)

at 
org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)

at 
org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:41)

at 
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:130)

at 
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:736)

at 
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:696)

at 
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:674)

at 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:318)

at 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)

at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1189)

at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1179)

at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1076)

at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)



I'm debugging with Intellij IDEA on Windows 10



Thank you for any help with this

This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and notify us 
immediately.