Search code examples
jmsejb-3.1websphere-8message-driven-bean

Annotation equivalent for activation-spec-binding-name


I'm migrating an application from Websphere Application Server 7 to 8.5. The application uses a MessageDrivenBean with JMS Activation Specification to consume messages from a queue. In the previous version we used the ibm-ejb-jar-bnd.xml to bind the activation spec:

<ejb-jar-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd"
    version="1.0">
    <message-driven name="SampleMDB">
        <jca-adapter activation-spec-binding-name="jms/as/sample" activation-spec-auth-alias="" />
    </message-driven>
</ejb-jar-bnd>

Is there an annotation equivalent for the above to use in the MessageDrivenBean?

@MessageDriven
@TransactionManagement(TransactionManagementType.BEAN)
public class SampleMDB implements MessageListener {
    ...
}

Solution

  • No, MDB must be bound using binding file or manually during installation via console or script. There is currently no way to bind it via annotation, but you can safely use same binding file with version 8.5.