-
15. Re: Writing message to HornetQ
jdestef Jul 30, 2012 8:18 AM (in response to jdestef)Hi Keith,
One other thing, if I use a camel.jms binding for the service then the message is consumed from the queue without error.
Thanks
-
16. Re: Writing message to HornetQ
kcbabo Jul 30, 2012 1:36 PM (in response to jdestef)Yep - that's an issue with the JCA gateway in 0.5 Final:
https://issues.jboss.org/browse/SWITCHYARD-934
Good news is that it's been fixed and the nightly builds for 0.6 will work. To make it work with 0.5, a custom composer would be required for JMS/JCA bindings. The implementation of this custom composer could be identical to the fixed version available in 0.6:
-
17. Re: Writing message to HornetQ
jdestef Jul 30, 2012 11:13 PM (in response to kcbabo)Hi Keith,
Thanks, I think I'll give 0.6 a spin.
-
18. Re: Writing message to HornetQ
jdestef Jul 31, 2012 8:58 AM (in response to jdestef)Hi Keith,
Back on 7/27 you provided a sample nettyjms app that worked when configured with camel binding but not JCA binding. I looked in JIRA and didn't see anything. Has this been resolved in 0.6 also?
Thanks
-
19. Re: Writing message to HornetQ
kcbabo Jul 31, 2012 9:16 AM (in response to jdestef)Hey John,
It has not been resolved. Tomo will be back tomorrow and I going to wait for him to have a look. I filed a JIRA just now so that it doesn't get lost in the shuffle:
https://issues.jboss.org/browse/SWITCHYARD-969
If it turns out to be an issue with managing the transaction boundary, then there are actually two options. First, if a straightforward fix is available in the JCA gateway itself, then we can go that route. Second, another thing that Tomo has been looking at is filling out the rest of our transaction policy which would allow you to declare transactional behavior for the reference used to push the message out via JMS/JCA. I would prefer if we could do a better job of managing this in the gateway itself with the policy definition being a compatible back-up option.
cheers,
keith
-
20. Re: Writing message to HornetQ
igarashitm Aug 2, 2012 10:47 AM (in response to kcbabo)Hi John, Keith,
Sorry for the delay, as Keith said, when we don't have transaction handling from the outside of JCA outbound, it won't work at this moment.
I'm currently working on SWITCHYARD-748 that supports transaction initiation/completion by SwitchYard runtime according to the policy resolve this issue.
https://issues.jboss.org/browse/SWITCHYARD-748
For the meantime, you can add transaction boundary with adding bean service which begins/commits transaction. see this testcase:
This testcase itself is not a bean service, but you can use the same way - 1.lookup UserTransaction, 2.begin, 3.invoke service, 4.commit. And you can lookup the UserTransaction from JNDI in the AS7 real world but not using mixin.
@Keith
Do we need any option to support no transaction environment for JCA outbound? I'm not sure is there any way to use JCA managed connection factory with ignoring transaction at this moment though. I will take a look further.
Thanks,
Tomo
-
21. Re: Writing message to HornetQ
kcbabo Aug 2, 2012 2:43 PM (in response to igarashitm)Sorry for the delay, as Keith said, when we don't have transaction handling from the outside of JCA outbound, it won't work at this moment.
I'm currently working on SWITCHYARD-748 that supports transaction initiation/completion by SwitchYard runtime according to the policy resolve this issue.
This will help work around the problem, but it bleeds a gateway concern into the service implementation.@Keith
Do we need any option to support no transaction environment for JCA outbound? I'm not sure is there any way to use JCA managed connection factory with ignoring transaction at this moment though. I will take a look further.
I don't think it's necessarily a no transaction environment. This is an issue where the calling service is not executing within the context of a transaction. If the JCA outbound flow requires a transaction and one is not present, I see two possible outcomes:
1) Generate a fault/error stating that a transaction is required.
2) Start a local transaction within the gateway itself.
The current behavior (i.e. silently fail) needs to change. :-)
cheers,
keith
-
22. Re: Writing message to HornetQ
igarashitm Aug 2, 2012 4:08 PM (in response to igarashitm)Sorry it was wrong, we can send a message to HornetQ queue without transaction handling via JCA managed connection factory if there is no active transaction. The problem was just the JMSProcessor enables JMS local transaction by default, but doesn't commit it. If we disable JMS local transaction explicitly then it should work fine.
--- switchyard.xml.orig 2012-08-02 15:17:39.725259278 -0400 +++ switchyard.xml 2012-08-02 15:16:39.020051014 -0400 @@ -23,6 +23,7 @@ <jca:outboundInteraction> <jca:processor type="org.switchyard.component.jca.processor.JMSProcessor"> <jca:property name="destination" value="EvenQueue"/> + <jca:property name="transacted" value="false"/> </jca:processor> </jca:outboundInteraction> </jca:binding.jca>
When JTA transaction is provided the transacted attribute will be ignored, so I will change the default value of the transacted attribute to "false" to avoid unexpected behavior when transaction is not provided.
Thanks,
Tomo
-
23. Re: Writing message to HornetQ
kcbabo Aug 3, 2012 4:12 PM (in response to igarashitm)FYI - Tomo's fix has been pushed upstream and the next posted Hudson build (#540) will include it: