Bug 1015927 - Unable to access context properties for references in Bean services
Summary: Unable to access context properties for references in Bean services
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0 GA
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ER7
: 6.0.0
Assignee: Keith Babo
QA Contact: Tomas Rohovsky
URL:
Whiteboard:
Depends On:
Blocks: 1024882
TreeView+ depends on / blocked
 
Reported: 2013-10-06 21:54 UTC by Keith Babo
Modified: 2016-01-04 05:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1024882 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
reporducer (8.75 KB, application/zip)
2013-12-17 15:27 UTC, Tomas Rohovsky
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SWITCHYARD-1465 0 Major Closed Make Context and Message available to bean services on all paths 2016-11-30 05:00:12 UTC

Description Keith Babo 2013-10-06 21:54:30 UTC
Context properties and attachments are not available for references injected into bean services using @Reference.

Comment 1 JBoss JIRA Server 2013-10-07 11:00:37 UTC
Keith Babo <kbabo> updated the status of jira SWITCHYARD-1465 to Resolved

Comment 2 JBoss JIRA Server 2013-10-07 11:00:37 UTC
Keith Babo <kbabo> made a comment on jira SWITCHYARD-1465

pushed

Comment 3 JBoss JIRA Server 2013-10-07 11:03:10 UTC
Keith Babo <kbabo> updated the status of jira SWITCHYARD-1465 to Reopened

Comment 6 Tomas Rohovsky 2013-12-17 15:27:02 UTC
Created attachment 837731 [details]
reporducer

Comment 7 Tomas Rohovsky 2013-12-17 15:27:41 UTC
Properties set to a reply in one bean component are null in the receiving bean component. I have attached a reproducer. Everything else seems to work as it should.

Comment 8 Tomas Rohovsky 2013-12-17 15:31:16 UTC
Steps to reproduce:
1. run AS
2. unpack reproducer
3. execute: mvn clean package jboss-as:deploy exec:java jboss-as:undeploy

Actual result:
Greetings to John Doe from ServiceA 
Greetings to John Doe from ServiceB [propertyB=null]

Expected result:
Greetings to John Doe from ServiceA 
Greetings to John Doe from ServiceB [propertyB=valueB]

Comment 9 Keith Babo 2013-12-17 15:43:09 UTC
This is actually an issue with the app.  The context you injected in ServiceBBean is for the request context.  This is the one corner case that was really hard to fit into the existing API.  The procedure to set a context property on the response is a bit convoluted unfortunately:

@Inject
Exchange exchange;

@Override
public String call(String name) {

   Message message = exchange.createMessage();
   message.setContent("Greetings to " + name + " from ServiceB");
   message.getContext().setProperty("propertyB", "valueB");
   exchange.send(message);
        
   // return ignored in favor of object used with send() above
   return null;
}

Comment 10 Tomas Rohovsky 2013-12-17 16:29:10 UTC
Just for completeness. The property can be obtained in ServiceABean this way:

String propertyB = invocation.getContext().getPropertyValue("propertyB");

Comment 11 JBoss JIRA Server 2014-06-16 23:53:16 UTC
Keith Babo <kbabo> updated the status of jira SWITCHYARD-1465 to Closed


Note You need to log in before you can comment on or make changes to this bug.