Bug 974980
| Summary: | Transaction handling is broken when calling a service from Camel component | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [JBoss] JBoss Fuse Service Works 6 | Reporter: | Jiri Pechanec <jpechane> | ||||
| Component: | SwitchYard | Assignee: | Keith Babo <kbabo> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Jiri Pechanec <jpechane> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.0.0 GA | CC: | atangrin, soa-p-jira | ||||
| Target Milestone: | ER1 | ||||||
| Target Release: | 6.0.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | Type: | Bug | |||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Jiri Pechanec
2013-06-17 10:06:12 UTC
Can you attach an app to reproduce this and also provide the error / stack trace you are seeing for the failure? Also, which build is this? Alpha1? Created attachment 762276 [details]
Reproducer
The issue is present in DR5
Rproducer is based on the QA camel-service. I added one bean service TransactionalServiceBean. The test works if the service is not marked as requires="managedTransaction.Global". When the policy is added (as is now) It throws an exception - about required policy,
Awesome catch on this issue. Chances are good we would have missed this for 1.0 Final if you didn't find it.
SwitchYardProducer, which is used to handle switchyard:// endpoints in a Camel route, is propagating context properties with a label of TRANSIENT which should not happen. This is definitely a bug and will be fixed for SY 1.0.0.Final.
IMO, I don't think this is a blocker for Alpha2 as it is confined to cases where multiple services are called from a Camel route with policy configured on the invoked service. I should mention there is a workaround available which involves adding a bean to your camel route to manually prune the offending context properties:
@Named("PolicyCleanup")
public class CleanContext {
public void clean(Exchange exchange) {
exchange.removeProperty("org.switchyard.exchange.transaction.initiated");
}
}
public void configure() {
from("switchyard://JavaDSL")
.log("Message received in Java DSL Route")
.log("${body}")
.to("switchyard://TransactedService")
.beanRef("PolicyCleanup")
.split(body(String.class).tokenize("\n"))
.to("switchyard://XMLService?operationName=acceptMessage");
}
This workaround is not ideal, obviously, but I think it's a minor annoyance for Alpha2 users. The fix for this is reasonably small, so we could consider delivering this as a patch on top of Alpha2 if it causes big trouble. This will be fixed in SY 1.0.0.Final and available in Beta builds for customers.
Keith Babo <kbabo> made a comment on jira SWITCHYARD-1550 pushed Verified in ER2 Keith Babo <kbabo> updated the status of jira SWITCHYARD-1550 to Closed |