[jboss-user] [EJB 3.0] - Re: JMS: using Websphere MQ as JMS provider.
adamhmitchell
do-not-reply at jboss.com
Mon Aug 13 15:36:43 EDT 2007
I think that ClassCastException happens when the JBossMQ code pulls your IBM MQ class from JNDI. You're still using the JBoss MDB JMS Provider.
I was in the same boat trying to use Sun's IMQ server. This is how I got it working:
| package elm.mdb;
|
| import javax.ejb.ActivationConfigProperty;
| import javax.ejb.MessageDriven;
| import javax.ejb.Remote;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import org.jboss.annotation.ejb.ResourceAdapter;
|
| import org.apache.log4j.Logger;
|
| @MessageDriven(mappedName = "jms/LoggingEventBean", activationConfig = {
| @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
| @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
| @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
| @ActivationConfigProperty(propertyName = "clientId", propertyValue = "LoggingEventBean"),
| //@ActivationConfigProperty(propertyName = "destination", propertyValue = "elm_topics_LoggingEvent_default"),
| @ActivationConfigProperty(propertyName = "destination", propertyValue = "EnterpriseLoggingTopic"),
| @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "LoggingEventBean")
| //@ActivationConfigProperty(propertyName = "UserName", propertyValue = "guest"),
| //@ActivationConfigProperty(propertyName = "Password", propertyValue = "guest")
| })
| @ResourceAdapter("imqjmsra.rar")
| public class LoggingEventBean implements MessageListener {
|
| static Logger logger = Logger.getLogger(LoggingEventBean.class);
|
| public LoggingEventBean() {
| }
|
| public void onMessage(Message message) {
| logger.info("got message");
|
| }
|
| }
|
I still don't know if this is the 'right' way to do it. Let me know if you find anything different!
AM
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073703#4073703
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073703
More information about the jboss-user
mailing list