The JMS resource adaptor creates a connection to either a queue or a topic based on this information. The other mandatory property is destination.
There is no way of knowing if the destination is a queue or a topic based only on the name of the destination. Therefore we can't set a correct default value if the destinationType property isn't filled in.
I guess that you are on page 109 of the JavaEE 5 spec in regards to injected resources - which states that the message-destination-type defaults to the injected target if not specified.
I think that the best solution would be to take the information from the injected target and fill in the information behind the scenes and leave the requirement of the JMS resource adaptor.
We are seeing problems with some of the tck tests not supplying a message-destination-type (it is optional in javaee5) and the activation layer complaining about this:
23:38:41,162 INFO [EJBContainer] STARTED EJB: com.sun.ts.tests.ejb30.bb.mdb.dest.common.DestBean ejbName: DestBean 23:38:41,225 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=mdb_dest_optional.ear,jar=mdb_dest_optional_ejb.jar,name=DestBean,service=EJB3 state=Create org.jboss.deployers.spi.DeploymentException: Required config property RequiredConfigPropertyMetaData@350bd2[name=destinationType descriptions=[DescriptionMetaData@c234ef[language=en]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigProperty(password=j2ee), ActivationConfigProperty(user=j2ee), ActivationConfigProperty(destination=MDB_QUEUE), ActivationConfigProperty(subscriptionDurability=false)] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar' at org.jboss.resource.deployment.ActivationSpecFactory.createActivationSpec(ActivationSpecFactory.java:95) at org.jboss.resource.deployers.RARDeployment.createActivationSpec(RARDeployment.java:313) at org.jboss.resource.deployers.RARDeployment.internalInvoke(RARDeployment.java:277) at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:156
Do we need to fill this info in
Yes you do.
The jms parameters are non-normative in the spec
so this can't be a compliance issue.
JavaEE connectors 1.5 appendix B
What that section does say is that the destinationType should be required
if it is not in the legacy mdb descriptor:
This property requires a value to be specified. The endpoint deployer must provide
a value for this property (if it is not already present in the endpoint deployment
It is also documentated as mandatory here:
We do copy it from the legacy mdb descriptor when it is not in the
activation spec and the jms inflow is configured
So quick fix:
Just add the destinationType activation config property to jboss.xml
or should this be getting defaulted?
We could try to default it by looking at the interfaces of the destination.
Nice for ease of use, but bad for people writing portable applications,
i.e. works on JBoss but fails on others because of missing mandatory configuration.