aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lin Sun <>
Subject [message driven service] integration with blueprint
Date Mon, 02 Aug 2010 19:00:56 GMT

A while back ago, I sent an update about the message-driven service
prototype I have been working on.   For the past few weeks, I have
updated the code to provide blueprint message driven services.
Basically, this means -

1. Users can use the message-driven elements to register their message
driven services in blueprint XML definition file.  Here is an example

	<md:message-driven id="myMessageDrivenBean"
		destroy-method="destory" interface="javax.jms.MessageListener">
			<md:entry key="destination" value="Hello.Queue" />
			<md:entry key="destinationType" value="javax.jms.Queue" />
		<md:transaction value="Required" />
		<md:argument ref="connectionFactory" />


which is equivalent to:

    <bean id="myMessageDrivenBean"
        <argument ref="connectionFactory" />

    <service ref="myMessageDrivenBean" interface="javax.jms.MessageListener">
                        <!-- for the activation config properties add
the relevant prefix to the property name -->
			<entry key="org.apache.aries.message.driven.destinationType"
value="javax.jms.Queue" />
			<entry key="org.apache.aries.message.driven.destination"
value="Hello.Queue" />
			<!-- transaction attribute based on the tx:transaction element in
blueprint -->

When the message-driven name space handler is invoked to parse the
message-driven element, it will create the bean metadata and service
metadata and register them in the component definition registry.

2. For transaction, I tried to reuse what we defined for declarative
transaction except that I try to keep it very simple.  You can only
specify bean level transaction with all methods having the same
transaction inside the message-driven service.  Similar as EJB
message-driven beans, only Required and NotSupported transaction
attributes are supported.   The blueprint transaction name space
handler is not being used here, instead the message-driven name space
handler is used to parse the transaction element here as we need to
convert it to the org.apache.aries.message.driven.transactionAttribute
service property so that the message-driven service container can
handle the transaction before and after the message is delivered.

Comments are welcome!


View raw message