That explains it. It turns out in this case I unintentionally instructed Camel to load a Spring file with a defined JMSTransactionHandler. Even though the file/mail endpoint doesn't participate with transactions, since Camel saw "transacted()" it found the JMSTransactionHandler definition and tried to use it which it couldn't because I didn't have a broker defined on the server.
So, in short, to achieve the "pseudo transactional" support I was looking for, I just needed to remove the ".transacted()" and make sure that the error handler set ".handled(false)". Thank you for expedient help in figuring out what I did wrong. Cheers, ~Justin -----Original Message----- From: Claus Ibsen [mailto:claus.ib...@gmail.com] Sent: Friday, December 16, 2011 11:28 AM To: users@camel.apache.org Subject: Re: Email and File .transacted() Hi You should not have transacted in the Camel route if you do not use JMS or JDBC etc. On Fri, Dec 16, 2011 at 6:16 PM, Justin Rosenberg <rosenbe...@crlcorp.com> wrote: > I'm not sure why my JTA is trying to use JMS Transaction. I will do some > digging. This is what I have in Spring. > > <!-- JTA Transaction Management --> > <bean id="transactionManager" > class="org.springframework.transaction.jta.JtaTransactionManager"> > <property name="transactionManagerName" > value="java:/TransactionManager" /> > <property name="allowCustomIsolationLevels" value="true" /> > </bean> > > Thanks for your help. > > ~Justin > > > -----Original Message----- > From: Claus Ibsen [mailto:claus.ib...@gmail.com] > Sent: Friday, December 16, 2011 11:07 AM > To: users@camel.apache.org > Subject: Re: Email and File .transacted() > > On Fri, Dec 16, 2011 at 5:59 PM, Justin Rosenberg > <rosenbe...@crlcorp.com> wrote: >> So my question is, why is it looking for a JMS queue when I use >> .transacted(). I would assume I wouldn't need a JMS queue to do this >> "pseudo-transactional" route. >> > > You must have a JTA transaction manager defined in some XML file > somehere, that the .transacted() will lookup and use (convention over > configuration). > And the JTA transaction manager is wrongly configured. See the message > in the stacktrace that says something about a broker not found. > > > >> Logs: >> 2011-12-16 09:34:59,298 INFO [JtaTransactionManager] Using JTA >> UserTransaction: >> org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1318e59 >> 2011-12-16 09:34:59,298 INFO [JtaTransactionManager] Using JTA >> TransactionManager: >> com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate@787ee7 >> ... >> 2011-12-16 09:35:14,509 WARN [TransactionErrorHandler] Transaction rollback >> (0x1fc212d) for ExchangeId: ID-C1002822-3963-1324049699423-0-2 >> due exception: Could not create JMS transaction; nested exception is >> javax.jms.JMSException: Could not create Transport. Reason: >> java.io.IOException: Broker named 'localhost' does not exist. >> >> >> Application versions: >> Camel 2.7.0 >> Spring 3.0.5.RELEASE >> >> ~Justin >> >> >> -----Original Message----- >> From: Claus Ibsen [mailto:claus.ib...@gmail.com] >> Sent: Friday, December 16, 2011 10:54 AM >> To: users@camel.apache.org >> Subject: Re: Email and File .transacted() >> >> On Fri, Dec 16, 2011 at 5:46 PM, Justin Rosenberg >> <rosenbe...@crlcorp.com> wrote: >>> Interesting. It seems that if I have >>> from(emailURI).transacted().process(processor) with a JMSTransactionManager >>> defined. It DOES work. If the following processor fails, the file/email >>> is left on the server... >>> >> >> That is because the Camel components uses UnitOfWork to defer the >> until the end when the exchange is done. >> Then they check the exchange status. >> >> If its okay, then they carry out their "commit" work such as for >> email, to mark the mail as DELETED | SEEN >> Likewise the file consumer will move the file / delete the file etc. >> >> However if the exchange is failed due an exception, then they will >> "compensate". Which mean usually they do not do any work. >> The email will leave the mail as is. >> The file will leave the file as is. >> >> So its "pseudo" transaction. But they do not participate in the >> transaction, and nor are they orchestrated by the transaction manager. >> Likewise they cannot participate in a XA 2-phase commit etc. >> >> >> >>> ~Justin >>> >>> >>> -----Original Message----- >>> From: Claus Ibsen [mailto:claus.ib...@gmail.com] >>> Sent: Friday, December 16, 2011 10:42 AM >>> To: users@camel.apache.org >>> Subject: Re: Email and File .transacted() >>> >>> Hi >>> >>> No transaction only works with resources which naturally supports >>> transactions. In reality this is often only limited to RDBMS and JMS >>> or the likes. >>> So email and file does not support transactions. >>> >>> If you send an email, its sent. >>> If you write a file, its written. >>> >>> However you can implement custom compensation logic to do work like a >>> rollback. >>> For example to delete the written file, etc. >>> >>> If you got the Camel in Action book, then chapter 9 is all about >>> transaction and compensations. >>> >>> >>> On Fri, Dec 16, 2011 at 4:34 PM, Justin Rosenberg >>> <rosenbe...@crlcorp.com> wrote: >>>> Does the File and Email endpoint require a JMS transaction provider to >>>> do transactions or can it use JTA instead? >>>> >>>> >>>> ~Justin >>>> >>>> >>>> -----Original Message----- >>>> From: Justin Rosenberg [mailto:rosenbe...@crlcorp.com] >>>> Sent: Tuesday, December 06, 2011 7:47 PM >>>> To: users@camel.apache.org >>>> Subject: Mail component ContentTypeResolver SPI customization >>>> >>>> I'm having trouble understanding how to use a custom ContentTypeResolver >>>> for the mail component using Spring. >>>> >>>> Here is my Spring XML: >>>> <camel:camelContext >>>> id="CamelContext-${project.artifactId}_${project.version}"> >>>> <camel:contextScan /> >>>> </camel:camelContext> >>>> <bean id="mail" class="org.apache.camel.component.mail.MailComponent"> >>>> <property name="contentTypeResolver"> >>>> <bean class="com.crlcorp.oasis.routing.util.CRLContentTypeResolver" >>>> /> >>>> </property> >>>> </bean> >>>> >>>> I'm retrieving the attachment in the processor as follows: >>>> DataHandler dh = >>>> exchange.getIn().getAttachments().values().iterator().next(); >>>> String contentType = dh.getContentType(); >>>> >>>> For testing I have the ContentTypeResolver always return the same value. >>>> However, the value that gets returned by dh.getContentType() is >>>> "APPLICATION/OCTET-STREAM; name="file.pdf" >>>> Am I missing a step to get the CamelContext to recognize the customized >>>> MailComponent? I have tried using the same Spring XML setting the value >>>> on the MailEndpoint as well. >>>> >>>> Application versions: >>>> Camel 2.7.0 >>>> Spring 3.0.5.RELEASE >>>> >>>> Any help is appreciated. >>>> >>>> Cheers, >>>> >>>> ~Justin >>>> >>>> >>>> >>>> >>>> CONFIDENTIALITY NOTICE: >>>> The information in this message, and any attachment, is intended for the >>>> >>>> sole use of the individual and entity to whom it is addressed. This >>>> information may be privileged, confidential, and protected from >>>> disclosure. If you are not the intended recipient you are hereby >>>> notified >>>> that you have received this communication in error and that any review, >>>> disclosure, dissemination, distribution or copying of it, or its >>>> contents, >>>> is strictly prohibited. If you think that you have received this message >>>> >>>> in error please notify the sender and destroy all copies of this >>>> communication and any attachments. Thank you. >>>> >>>> CONFIDENTIALITY NOTICE: >>>> The information in this message, and any attachment, is intended for the >>>> sole use of the individual and entity to whom it is addressed. This >>>> information may be privileged, confidential, and protected from >>>> disclosure. If you are not the intended recipient you are hereby notified >>>> that you have received this communication in error and that any review, >>>> disclosure, dissemination, distribution or copying of it, or its contents, >>>> is strictly prohibited. If you think that you have received this message >>>> in error please notify the sender and destroy all copies of this >>>> communication and any attachments. Thank you. >>> >>> >>> >>> -- >>> Claus Ibsen >>> ----------------- >>> FuseSource >>> Email: cib...@fusesource.com >>> Web: http://fusesource.com >>> Twitter: davsclaus, fusenews >>> Blog: http://davsclaus.blogspot.com/ >>> Author of Camel in Action: http://www.manning.com/ibsen/ >>> >>> CONFIDENTIALITY NOTICE: >>> The information in this message, and any attachment, is intended for the >>> sole use of the individual and entity to whom it is addressed. This >>> information may be privileged, confidential, and protected from >>> disclosure. If you are not the intended recipient you are hereby notified >>> that you have received this communication in error and that any review, >>> disclosure, dissemination, distribution or copying of it, or its contents, >>> is strictly prohibited. If you think that you have received this message >>> in error please notify the sender and destroy all copies of this >>> communication and any attachments. Thank you. >> >> >> >> -- >> Claus Ibsen >> ----------------- >> FuseSource >> Email: cib...@fusesource.com >> Web: http://fusesource.com >> Twitter: davsclaus, fusenews >> Blog: http://davsclaus.blogspot.com/ >> Author of Camel in Action: http://www.manning.com/ibsen/ >> >> CONFIDENTIALITY NOTICE: >> The information in this message, and any attachment, is intended for the >> sole use of the individual and entity to whom it is addressed. This >> information may be privileged, confidential, and protected from >> disclosure. If you are not the intended recipient you are hereby notified >> that you have received this communication in error and that any review, >> disclosure, dissemination, distribution or copying of it, or its contents, >> is strictly prohibited. If you think that you have received this message >> in error please notify the sender and destroy all copies of this >> communication and any attachments. Thank you. > > > > -- > Claus Ibsen > ----------------- > FuseSource > Email: cib...@fusesource.com > Web: http://fusesource.com > Twitter: davsclaus, fusenews > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/ > > CONFIDENTIALITY NOTICE: > The information in this message, and any attachment, is intended for the > sole use of the individual and entity to whom it is addressed. This > information may be privileged, confidential, and protected from > disclosure. If you are not the intended recipient you are hereby notified > that you have received this communication in error and that any review, > disclosure, dissemination, distribution or copying of it, or its contents, > is strictly prohibited. If you think that you have received this message > in error please notify the sender and destroy all copies of this > communication and any attachments. Thank you. -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ CONFIDENTIALITY NOTICE: The information in this message, and any attachment, is intended for the sole use of the individual and entity to whom it is addressed. This information may be privileged, confidential, and protected from disclosure. If you are not the intended recipient you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it, or its contents, is strictly prohibited. If you think that you have received this message in error please notify the sender and destroy all copies of this communication and any attachments. Thank you.