Topic
  • 4 replies
  • Latest Post - ‏2011-09-06T15:29:25Z by SystemAdmin
SystemAdmin
SystemAdmin
126 Posts

Pinned topic Implementation OSGI App with JMS binding

‏2011-08-31T22:26:28Z |
1. We have a simple SCA Component with a service (with jms binding with no interface) and a component implementation of OSGI Application with a simple request / response message flow.

I need to configure the transaction intent in such a way that, I want to start a global transaction which spans from message consumption from a mq request queue --> interacts with osgi application --> dropping the response message in the response queue.

I am assuming propagatetransaction on service would suffice for this requirement. However, It does'nt appear specifying propagatetransaction intent on service is working as I am getting this during deployment. (Adding SCA composition unit to the business-level application). Can you please advice, whether not specifying any intent will default to propagate transaction. It appears to me the underneath the covers JMS Binding on service implements a MDB, so it must be going with a default transaction attribute.

com.ibm.wsspi.management.bla.op.OpExecutionException: CWSAM0105E: The following Service Component Architecture (SCA) Validation errors caused the CreateScaCodeGen step to fail: 1 Policy Related Exception occured due to : org.apache.tuscany.sca.assembly.builder.impl.PolicyConfigurationException: The following are unfulfilled intents for binding in service - ProcessMessageBeanService Unfulfilled Intents = {http://www.osoa.org/xmlns/sca/1.0}propagatesTransaction

2. I don't see any tools which can help me build defintions.xml thru RAD where I can specify custom intents and policy sets etc. Is it not supported in RAD 8 ?

3. I also read that transaction intent for implementation:osgiapp cannot be specified as intent. Looks like it needs to be specified thru blueprint implementation as "<entry key="service.exported.intents" value="propagatesTransaction"/>" for the exported service. Can anyone confirm.
Updated on 2011-09-06T15:29:25Z at 2011-09-06T15:29:25Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Implementation OSGI App with JMS binding

    ‏2011-09-01T14:56:42Z  
    Hi Sriram,

    From the perspective of the JMS binding it sounds like you want the exactlyOnce intent, as described here.

    Unfortunately I don't know the full answer of how to align the blueprint properties and the SCA intents.

    I do see here that the default transaction policy for blueprint components is Required. That seems like what you want in terms of declaring that the container will invoke the implementation as part of the existing unit of work (transaction) that the JMS binding request/response are running under. This combined with the exactlyOnce intent would seem to put everything under a single unit of work as you wished.

    However, I don't know the answer to your third question, i.e. what the blueprint XML needs to specify regarding intents.

    I see the rest of that 2nd article refers to the SCA propagatesTransaction intent, and I'm not sure if it's simply an oversight that exactlyOnce was not also mentioned, or if propagatesTransaction is really what was intended. I'm not sure it even matters, to be honest, as, like we say in this article, part of the purpose of intent on the implementation is just to document that an appropriate binding (which supports that intent), must be used.

    I realize that must all sound confusing, so will try to find someone to answer your question better.

    But I thought it was worth answering without knowing in case you wanted to give the exactlyOnce a try in the meantime.

    Also, I'm not sure about the answer to your question #2. I'd have to have more of an expert on the subject (or read our doc more carefully) advise me whether it is possible purely from the SCA runtime perspective, regardless of whether RAD offers tooling to assist.

    I'm just curious, though, what type of custom intent & policy set were you interested in defining?

    Regards,
    Scott Kurz
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Implementation OSGI App with JMS binding

    ‏2011-09-02T16:08:16Z  
    Hi Sriram,

    From the perspective of the JMS binding it sounds like you want the exactlyOnce intent, as described here.

    Unfortunately I don't know the full answer of how to align the blueprint properties and the SCA intents.

    I do see here that the default transaction policy for blueprint components is Required. That seems like what you want in terms of declaring that the container will invoke the implementation as part of the existing unit of work (transaction) that the JMS binding request/response are running under. This combined with the exactlyOnce intent would seem to put everything under a single unit of work as you wished.

    However, I don't know the answer to your third question, i.e. what the blueprint XML needs to specify regarding intents.

    I see the rest of that 2nd article refers to the SCA propagatesTransaction intent, and I'm not sure if it's simply an oversight that exactlyOnce was not also mentioned, or if propagatesTransaction is really what was intended. I'm not sure it even matters, to be honest, as, like we say in this article, part of the purpose of intent on the implementation is just to document that an appropriate binding (which supports that intent), must be used.

    I realize that must all sound confusing, so will try to find someone to answer your question better.

    But I thought it was worth answering without knowing in case you wanted to give the exactlyOnce a try in the meantime.

    Also, I'm not sure about the answer to your question #2. I'd have to have more of an expert on the subject (or read our doc more carefully) advise me whether it is possible purely from the SCA runtime perspective, regardless of whether RAD offers tooling to assist.

    I'm just curious, though, what type of custom intent & policy set were you interested in defining?

    Regards,
    Scott Kurz
    Hi,

    I think I have a more complete answer now.

    First, for #2, whether RAD lets you create custom intents and/or policy sets or not, the SCA Feature Pack runtime does not support using the definitions.xml to define either.

    We briefly refer to this in the section of our doc where we list elements of the OSOA specification that we don't support. See section SCA Policy Framework.

    When using the web services binding (binding.ws), you can attach WS policy sets (either pre-packaged or custom-defined), but you cannot do this with the JMS binding (binding.jms). Note that we do support SOAP/JMS configurations of binding.ws, to which you can attach policy sets, but I'm probably getting ahead of myself here.

    As far as question #3, (assuming we're still using the JMS binding), you do not need to set the service.exported.intents property in the blueprint XML. I believe you can set this intent at either the binding level or the component level (for implementation.osgiapp the component level would be set via blueprint XML, not via a composite file). If you were to set it in both places, (you might want to in order to document the requirement from each of the SCA, OSGI perspectives), the two settings should be compatible.

    So your original error reflected the fact that the JMS binding cannot support the propagatesTransaction intent declared at the component level, though like I mentioned earlier it sounds like you want the exactlyOnce intent.

    Hope that helps,
    Scott
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Implementation OSGI App with JMS binding

    ‏2011-09-02T16:53:33Z  
    Hi,

    I think I have a more complete answer now.

    First, for #2, whether RAD lets you create custom intents and/or policy sets or not, the SCA Feature Pack runtime does not support using the definitions.xml to define either.

    We briefly refer to this in the section of our doc where we list elements of the OSOA specification that we don't support. See section SCA Policy Framework.

    When using the web services binding (binding.ws), you can attach WS policy sets (either pre-packaged or custom-defined), but you cannot do this with the JMS binding (binding.jms). Note that we do support SOAP/JMS configurations of binding.ws, to which you can attach policy sets, but I'm probably getting ahead of myself here.

    As far as question #3, (assuming we're still using the JMS binding), you do not need to set the service.exported.intents property in the blueprint XML. I believe you can set this intent at either the binding level or the component level (for implementation.osgiapp the component level would be set via blueprint XML, not via a composite file). If you were to set it in both places, (you might want to in order to document the requirement from each of the SCA, OSGI perspectives), the two settings should be compatible.

    So your original error reflected the fact that the JMS binding cannot support the propagatesTransaction intent declared at the component level, though like I mentioned earlier it sounds like you want the exactlyOnce intent.

    Hope that helps,
    Scott
    Just reading this over one more time.... and realizing this is more confusing than necessary (and this is a tricky subject to begin with):

    I'd said:

    "I believe you can set this intent at either the binding level or the component level (for implementation.osgiapp the component level would be set via blueprint XML, not via a composite file)."

    Let me take another shot at this:

    In general, (i.e. for any implementation type), you would set the exactlyOnce intent on the service element in the composite file, e.g.:

    <component name="MyComponent">
    <service name="MyService" requires="exactlyOnce">

    However, for implementation.osgiapp there is an additional option having the exact same result by which you may set this at the service level. This is by using the blueprint XML, e.g.:

    <service ...
    <entry key="service.exported.intents" value="exactlyOnce"/>"

    Each of these have the same result in the implementation.osgiapp case.

    By the way, this does assume, like I mentioned earlier, that you have an appropriate transaction policy configured at the blueprint level for the component, though like I also mentioned the default of Required should work for you.

    Hope that helps,
    Scott
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Implementation OSGI App with JMS binding

    ‏2011-09-06T15:29:25Z  
    Just reading this over one more time.... and realizing this is more confusing than necessary (and this is a tricky subject to begin with):

    I'd said:

    "I believe you can set this intent at either the binding level or the component level (for implementation.osgiapp the component level would be set via blueprint XML, not via a composite file)."

    Let me take another shot at this:

    In general, (i.e. for any implementation type), you would set the exactlyOnce intent on the service element in the composite file, e.g.:

    <component name="MyComponent">
    <service name="MyService" requires="exactlyOnce">

    However, for implementation.osgiapp there is an additional option having the exact same result by which you may set this at the service level. This is by using the blueprint XML, e.g.:

    <service ...
    <entry key="service.exported.intents" value="exactlyOnce"/>"

    Each of these have the same result in the implementation.osgiapp case.

    By the way, this does assume, like I mentioned earlier, that you have an appropriate transaction policy configured at the blueprint level for the component, though like I also mentioned the default of Required should work for you.

    Hope that helps,
    Scott
    Thank you so much scott. I was playing around with those settings, hence the delay in reply. At the end whatever I did pretty much matched up with your answer.

    I defined the jms service binding intent to "exactlyonce"
    and also defined the component implementation bean (blueprint.xml) transaction as "Required" and after forcing a unchecked exception in the component implementation class, the message rolled back to the destination.

    However I haven't tried this configuration in blueprint service.
    <entry key="service.exported.intents" value="exactlyOnce"/>. From your reply it appears that this entry is just an alternate solution to the one I mentioned above. I kept trying with
    <entry key="service.exported.intents" value="propagatetransaction"/> configuration and pretty much hit the wall.

    The documentation on IBM sites for transaction intents (especially for JMS binding with OSGI implementation) could have been little bit clearer. I really appreciate your help. Thanks again !