--camel config--
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
<package>cameltest</package>
</camelContext>
<bean id="mqseries" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="myProxyConnectionFactory" />
<property name="transacted" value="true"/>
</bean>
<bean id="myProxyConnectionFactory"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="mqConFactory"/>
<property name="username" value=" "/>
<property name="password" value=" "/>
</bean>
<bean id="mqConFactory" class="com.ibm.mq.jms.MQConnectionFactory">
(properties to connect to my mqseries machine)
</bean>
--RouteBuilder code--
public void configure() {
from("mqseries:integrator_test").process(new Processor() {
public void process(Exchange exch) throws Exception {
Process print =
Runtime.getRuntime().exec("execute print command");
if(print.returnVal != 0) {
throw new Exception("Print was not
successful.");
}
}
});
}
Thanks for any help.
Hadrian Zbarcea wrote:
>
> Hi, not sure how you set up your routes. There is a
> TransactedJmsRouteTest you could look at or you could send your whole
> configuration.
>
> Cheers
> Hadrian
>
> On Jan 29, 2008, at 3:45 PM, Stephen J wrote:
>
>>
>> I am trying to create a small program that reads off an mqseries jms
>> queue
>> and prints some of the information in the message to a printer. I
>> would like
>> to encapsulate the code in a transaction, so that if a problem
>> occurs with
>> the printer, the message will stay on the queue until the problem is
>> resolved.
>>
>> I've tried adding the transacted property to my JmsComponent as
>> follows:
>>
>> <property name="transacted" value="true"/>
>>
>> But, when the program reads from the queue and fails to print, the
>> message
>> is gone from the queue. In other words, the rollback doesn't seem to
>> occur.
>>
>> Please let me know if I need to add additional code to make the
>> rollback
>> happen.
>>
>> Thanks,
>> Stephen
>> --
>> View this message in context:
>> http://www.nabble.com/JMS-Transactions---How-To-tp15168958s22882p15168958.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
--
View this message in context:
http://www.nabble.com/JMS-Transactions---How-To-tp15168958s22882p15169641.html
Sent from the Camel - Users mailing list archive at Nabble.com.