Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 996010

Summary: RTGov logs interface for one-way operation as null value
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Jiri Pechanec <jpechane>
Component: RT GovernanceAssignee: Gary Brown <gbrown>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Sedlacek <jsedlace>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0 GACC: atangrin, kbabo, oskutka, soa-p-jira
Target Milestone: ER2Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-06 15:27:23 UTC 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:
Bug Depends On: 996366    
Bug Blocks:    
Attachments:
Description Flags
Reproducer none

Description Jiri Pechanec 2013-08-12 08:16:50 UTC
Try to invoke a one-way operation and look at generated Activities.

Examples for RequestSent and RequestReceived activities
10:08:57,134 INFO  [org.jboss.soa.qa.rtgactivity.RTGovSwitchYardTest] (pool-1-thread-10) Asserting RequestSent: serviceType={urn:switchyard-soa:rtgov_activity_generation:0.1.0}InventoryService/LoggingService interface=null operation=logMessage fault=null messageType=java:java.lang.String content=null
10:08:57,134 INFO  [org.jboss.soa.qa.rtgactivity.RTGovSwitchYardTest] (pool-1-thread-10) Asserting RequestReceived: serviceType={urn:switchyard-soa:rtgov_activity_generation:0.1.0}InventoryService/LoggingService interface=null operation=logMessage fault=null messageType=java:java.lang.String content=null
10:08:57,143 INFO  [org.jboss.soa.qa.rtgactivity.RTGovSwitchYardTest] (pool-1-thread-10) Asserting RequestSent: serviceType={urn:switchyard-soa:rtgov_activity_generation:0.1.0}OrderService/InventoryService interface=null operation=reserveItem fault=null messageType=java:org.jboss.soa.qa.shared.data.OrderItem content=null

See interface field. For two-way operations the interface is logged correctly

Comment 1 Gary Brown 2013-08-12 08:24:51 UTC
Can you provide the app to reproduce, with an example message.

Comment 2 Jiri Pechanec 2013-08-12 09:11:01 UTC
Created attachment 785622 [details]
Reproducer

See modified camel-binding quickstart - there is a logging service added

Run the quickstart - be careful with directory settings, it needs to be changed
Then run the REST request

{"expression": "SELECT act FROM RPCActivityType act LEFT JOIN FETCH act.context LEFT JOIN FETCH act.properties" } 

on url http://localhost:8080/overlord-rtgov/activity/query

The answer should contain
   {
    "type":"RequestSent",
    "serviceType":"{
    urn:switchyard-quickstart:camel-binding:0.1.0
}GreetingService/LoggingService",
    "operation":"log",
    "messageType":"java:java.lang.String",
    "timestamp":1376298336203,
    "unitId":"872766c6-c858-449b-b82b-83421c1fcc2e",
    "unitIndex":1,
    "context":[{
    "value":"ID-jpechane-34089-1376298164800-3-5",
    "type":"Message"
}]
},
    {
    "type":"RequestReceived",
    "serviceType":"{
    urn:switchyard-quickstart:camel-binding:0.1.0
}GreetingService/LoggingService",
    "operation":"log",
    "messageType":"java:java.lang.String",
    "timestamp":1376298336203,
    "unitId":"872766c6-c858-449b-b82b-83421c1fcc2e",
    "unitIndex":2,
    "context":[{
    "value":"ID-jpechane-34089-1376298164800-3-5",
    "type":"Message"
}]
},
    {
    "type":"RequestSent",
    "serviceType":"{
    urn:switchyard-quickstart:camel-binding:0.1.0
}GreetingService/LoggingService",
    "operation":"log",
    "messageType":"java:java.lang.String",
    "timestamp":1376298336210,
    "unitId":"872766c6-c858-449b-b82b-83421c1fcc2e",
    "unitIndex":3,
    "context":[{
    "value":"ID-jpechane-34089-1376298164800-3-7",
    "type":"Message"
}]
},
    {
    "type":"RequestReceived",
    "serviceType":"{
    urn:switchyard-quickstart:camel-binding:0.1.0
}GreetingService/LoggingService",
    "operation":"log",
    "messageType":"java:java.lang.String",
    "timestamp":1376298336210,
    "unitId":"872766c6-c858-449b-b82b-83421c1fcc2e",
    "unitIndex":4,
    "context":[{
    "value":"ID-jpechane-34089-1376298164800-3-7",
    "type":"Message"
}

Note the missing intefrace field

Comment 3 Gary Brown 2013-08-12 15:10:32 UTC
Marked as not a bug, as this information is not provided, on 'inbound' exchanges between services, by switchyard. Therefore it is not possible for rtgov to log this.

As a workaround, for two way interactions, the interface on the 'outbound' exchange is applied to the activity events representing the inbound interaction, after the fact.

Comment 4 Gary Brown 2013-08-12 15:18:39 UTC
Just to be clear, this is not an rtgov bug, which is why I closed it - however I believe this information should be provided, so possibly needs to be raised as bug against switchyard.

RTGov currently uses the org.apache.camel.management.event.ExchangeCreatedEvent, although the same problem exists with org.switchyard.runtime.event.ExchangeInitiatedEvent.

Comment 5 Jiri Pechanec 2013-08-13 04:31:55 UTC
I am re-opening the bug and making it a dependency on SY bug that should provide the necessary information. If the SY issue will solve the problem we can close it together.

Comment 6 Gary Brown 2013-08-13 09:37:28 UTC
Have found a workaround for this, that sets the interface and also scopes the oneway interaction (i.e. records response sent/received events).

So you may want to close the switchyard issue. I'm testing the fix currently, but looks like it will be fine, so should apply to product branch shortly.

Comment 7 Keith Babo 2013-08-20 16:02:41 UTC
It's not clear to me what exactly is missing on the SwitchYard side.  At the point the exchange is initiated, the consumer has been identified, but the provider has not (that's assigned in the addressing handler).  This means the consumer's contract information *is* present on the exchange.  This holds true inbound or outbound, in-only or in-out.

This bug seems to talk about what's missing on the RTGov side and the SY bug that was created merely references this one.  Can someone point out the exact information which should be there that is missing?

Comment 8 Gary Brown 2013-08-20 16:13:57 UTC
The problem was that when handling the request in the event listener, the provider (i.e. org.switchyard.Service) interface property is null.

I had worked around this for two way ops by setting the interface in the activity event when handling the response, but this bug was because it wasn't being handled for one-way ops. So the fix was to basically do the same workaround for one-way ops.

Comment 9 Keith Babo 2013-08-20 16:30:59 UTC
OK, provider will always be null in that scenario.  Happy to hear that you have a workaround from the rtgov side.  Let me know if you run into any other issues.

Comment 10 Jiri Pechanec 2013-09-16 09:23:06 UTC
Verified in ER2

Comment 14 JBoss JIRA Server 2014-07-02 09:19:48 UTC
Gary Brown <gary> updated the status of jira RTGOV-248 to Closed