How to configure a JMS Queue

Hi,
I have an EAR file thai includes an EJB 3.0 module with a MDB. I use a Queue.
This is my code,
@Resource(mappedName = "jms/NotificationQueue")
private Queue notificationQueue;
@Resource(mappedName = "jms/NotificationQueueFactory")
private ConnectionFactory notificationQueueFactory;
public Customer update(Customer customer){
Customer updated = em.merge(customer);
try {
sendJMSMessageToNotificationQueue(updated);
} catch (JMSException ex) {
Logger.getLogger(CustomerSessionBean.class.getName()).log(Level.SEVERE, null, ex);
System.out.println("Customer updated in CustomerSessionBean!");
return updated;
private Message createJMSMessageForjmsNotificationQueue(Session session, Object messageData) throws JMSException
//Modified to use ObjectMessage instead
ObjectMessage tm = session.createObjectMessage();
tm.setObject((Serializable) messageData);
return tm;
private void sendJMSMessageToNotificationQueue(Object messageData) throws JMSException
Connection connection = null;
Session session = null;
try
connection = notificationQueueFactory.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer messageProducer = session.createProducer(notificationQueue);
messageProducer.send(createJMSMessageForjmsNotificationQueue(session, messageData));
finally
if (session != null)
try
session.close();
catch (JMSException e)
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Cannot close session", e);
if (connection != null)
connection.close();
layed inside a stateless EJB 3.0.
And the MDB looks as follow,
@MessageDriven(mappedName = "jms/NotificationQueue", activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
public class NotificationBean implements MessageListener {
public NotificationBean() {
public void onMessage(Message message)
try
Object msgObj = ((ObjectMessage)message).getObject();
if (msgObj != null)
Customer customer = (Customer)msgObj;
System.out.println("Customer with the following details has been updated:");
StringBuilder sb = new StringBuilder();
sb.append("Customer ID=");
sb.append(customer.getCustomerId());
sb.append(", ");
sb.append("Name=");
sb.append(customer.getName());
sb.append(", ");
sb.append("Email=");
sb.append(customer.getEmail());
System.out.println(sb.toString());
catch (JMSException ex)
Logger.getLogger(NotificationBean.class.getName()).log(Level.SEVERE, null, ex);
I have configured both "jms/NotificationQueue" and "jms/NotificationQueueFactory" inside OC4J server.
But when I try to deploy the EAR file, the server gives me the following error,
Operation failed with error: No destination location set for message-driven bean NotificationBean
How must I do to let the EAR file be deployed?
Thanks in advance
Jose

Mingzhuang
I want to configure a error queue for weblogic jms topic. Wanted: The message goes to error destination when messages have expired or reached their redelivery limit.
1. using jms transport configure proxy service:
Retry Count :3
Retry Interval:10
Error Destination: ErrorTopic
Expiration olicy: RedirectUnlike File/SFTP, JMS proxy service definition does not have the concept of Error Destination. To accomplish similar functionality go to JMSQ on (for which proxy is configured) server console (http://localhost:7001/console) and configure the Error Destination. Following URL will help in how to configure JMS Q.
http://edocs.bea.com/wls/docs103/ConsoleHelp/taskhelp/jms_modules/queues/ConfigureQueues.html
http://edocs.bea.com/wls/docs103/ConsoleHelp/taskhelp/jms_modules/queues/ConfigureQueueDeliveryFailure.html
I tried use the proxy service to consume message from the jms topic . and generation an error in the proxy message flow. But the message didn't goes into the error topic.If every thing is configured as per above step, then the after retries, the weblogic server will put the message into JMS topic configured. Your proxy will receive from this topic.
Let me know if we are not on same page.
Cheers
Manoj

Similar Messages

  • How to configure my JMS QUEUE serve only one message at a time?

    Hi All,
    I have requirement where I need to develope a JMS QUEUE in weblogic. This MDB has to serve only one message at a time. Is there any way to configure via annotations or in weblogic server settings ?
    Any help would be really appreciated...
    Thank you,
    K.

    I'm not aware of any way to configure the max pool size via annotations, you might try posting to the EJB newsgroup (please post back the answer). Of course you can set the size via an EJB descriptor, as per the MDB chapter of the Performance and Tuning guide in the edocs.
    By the way, if you have ordered message processing requirements, I highly recommend taking a look at the WebLogic JMS "Unit-of-Order" (UOO) feature as per the UOO chapter of the JMS programmer's guide. For a variety of reasons, the UOO features is often, by far, the best option for handling such requirements. If this feature applies to your use case, then there would be no need to force single threaded message processing in some sort of manual fashion (the feature enforces this for you).
    Tom

  • How to configure the JMS application in WSAD 5.0

    hi
    i need to configure an JMS application in WSAD 5, but while configuring the application i am checked with intial context exception. but i have configured the jndi in the server. but i cant able to run the application.
    can anybody help me like how to configure the JMS application in WSAD (can we configure it without MQ simulator if yes i need the steps)
    thanks in advance

    Hi,
    did you check the WebSphere documentation or ask a question on an IBM forum?
    Frank

  • How to configure an jms adapter to use ActiveMQ?

    Does anyone have an example of how to configure an jms adapter of oracle esb
    for third party JMS provider to use ActiveMQ?
    I had done something as follow:
    1、add activemq shared-library in $SOA_INSTANCE/config/service.xml
    2、config a jms adapter fro third party use paramter:
         java.naming.factory.initial     org.apache.activemq.jndi.ActiveMQInitialContextFactory
         java.naming.provider.url     tcp://10.20.30.26:61615
    but I got a error:ERRJMS_CONN_FAC_NOT_FOUND.
    Caused by: javax.naming.NameNotFoundException: org.apache.activemq.ActiveMQConnectionFactory
         at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:225)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at oracle.tip.adapter.jms.JMS.JMSFactory.jndiLookup(JMSFactory.java:237)
         at oracle.tip.adapter.jms.JMS.JMSConnectionFactoryFactory.getConnectionFactory(JMSConnectionFactoryFactory.java:138)
         ... 51 more
    what should I do? can someone give me a detail resolvent?

    I also had done as follows:
    1、add activemq shared-library to shared-library named "oracle.esb" in server.xml :
    <shared-library name="oracle.esb" version="10.1.3">
              <import-shared-library name="apache.activemq"/>
    </shared-library>
    2、add in $SOA_INSTANCE\j2ee\soa\application-deployments\default\JmsAdapter\oc4j-ra.xml
         <imported-shared-libraries>
              <import-shared-library name="apache.activemq"/>
         </imported-shared-libraries>

  • How to manually flush jms queue

    hi,
              we have some transaction which is stuck in a JMS queue and we want to forcibly clear it from queue.
              please let me know how to go for this
              thanks

    Does anyone know how to publish a JMS queue? Thanks.Yes, I do. But rather than write a long posting describing how to use the JMS API. I'd like to invite you to read the JMS tutorial:
    http://download.oracle.com/javaee/1.3/jms/tutorial/index.html
    Look particularly at
    http://download.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/client.html
    Nigel

  • How to publish a JMS Queue?

    Hi there,
    Does anyone know how to publish a JMS queue? Thanks.
    Edited by: 886478 on Sep 20, 2011 10:17 PM

    Does anyone know how to publish a JMS queue? Thanks.Yes, I do. But rather than write a long posting describing how to use the JMS API. I'd like to invite you to read the JMS tutorial:
    http://download.oracle.com/javaee/1.3/jms/tutorial/index.html
    Look particularly at
    http://download.oracle.com/javaee/1.3/jms/tutorial/1_3_1-fcs/doc/client.html
    Nigel

  • How to configure a error queue for weblogic jms topic

    Hi guys.
    I want to configure a error queue for weblogic jms topic. Wanted: The message goes to error destination when messages have expired or reached their redelivery limit.
    1. using jms transport configure proxy service:
    Retry Count :3
    Retry Interval:10
    Error Destination: ErrorTopic
    Expiration Policy: Redirect
    I tried use the proxy service to consume message from the jms topic . and generation an error in the proxy message flow. But the message didn't goes into the error topic.
    Any suggestions for this topic? Can anyone provide some helps or any useful links.
    Thanks in advance.
    Mingzhuang

    Mingzhuang
    I want to configure a error queue for weblogic jms topic. Wanted: The message goes to error destination when messages have expired or reached their redelivery limit.
    1. using jms transport configure proxy service:
    Retry Count :3
    Retry Interval:10
    Error Destination: ErrorTopic
    Expiration olicy: RedirectUnlike File/SFTP, JMS proxy service definition does not have the concept of Error Destination. To accomplish similar functionality go to JMSQ on (for which proxy is configured) server console (http://localhost:7001/console) and configure the Error Destination. Following URL will help in how to configure JMS Q.
    http://edocs.bea.com/wls/docs103/ConsoleHelp/taskhelp/jms_modules/queues/ConfigureQueues.html
    http://edocs.bea.com/wls/docs103/ConsoleHelp/taskhelp/jms_modules/queues/ConfigureQueueDeliveryFailure.html
    I tried use the proxy service to consume message from the jms topic . and generation an error in the proxy message flow. But the message didn't goes into the error topic.If every thing is configured as per above step, then the after retries, the weblogic server will put the message into JMS topic configured. Your proxy will receive from this topic.
    Let me know if we are not on same page.
    Cheers
    Manoj

  • How toremove messages from JMS Queue?how to configure queue in spring?

    Hi
    I have Confiured a JMS configaration in spring applicationConfiguaration.xml file
    <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
              <property name="brokerURL" value="tcp://localhost:61616"/>
              <property name="useAsyncSend" value="true"/>
         </bean>
         <bean id="queue" class="org.apache.activemq.command.ActiveMQQueue">
         <constructor-arg value="foo"/>
    </bean>
         <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
              <property name="config" value="classpath:activemq.xml" />
              <property name="start" value="true" />
         <!--          <property name="messageListener" ref="auditInterface"/> -->
         </bean>
         <bean id="auditInterface"
              class="org.springframework.jms.remoting.JmsInvokerProxyFactoryBean">
    <property name="serviceInterface" value="com.infiniti.gpn.auditing.AuditInterface"/>
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="queue" ref="queue"/>
    </bean>
         <bean id="listenerContainer" class="org.springframework.jms.listener.SimpleMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destination" ref="queue"/>
    <property name="messageListener" ref="auditMessageListener"/>
         </bean>
    Sender is sedning messages continusly messages that messages r storing in queue , these r acupying more memory in RAM , due to that jboss is restarting for each request, is there any way to clean up messages in Queue ? if it is there then how will configure that queue in apllicationConfiguaration.xml file?
    Thanks in advance
    Nara

    I suggest posting your question on the [Spring Remoting and JMX forum|http://forum.springframework.org/forumdisplay.php?f=30].

  • How to create a JMS queue linked to external (remote) JMS server?

    Hello,
    I'm trying to receive messages from a remote JMS queue. I found some information on the Internet on how to create an external JNDI resource (my remote JMS queue connection factory is bound to LDAP context on remote box). I was able to configure JNDI resource that points to remote queue connection factory, but I don't know what to do next.
    How can I create a local JMS destination (queue) that will be the image of the remote queue? At least I'm guessing this is what needs to be done in order to deploy MDBs.
    I would appreciate it if someone could tell me how to get this working. Maybe the steps I took were not in the right direction - the bottom line is that JMS queue and queue connection factory are deployed on a remote server, and I need to get messages sent to them on the local server. I'm using Sun App Server from J2EE 1.4.
    Thank you,
    Mark

    Please refer to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6377822, particularly the evaluation. Could your situation be the same too (i.e server ip address changing dynamically)? Also, which OS are you using and do you have any firewalls setup that prevents access to port 3700?

  • QoS EOIO - How to Configure in JMS adapter?

    Hi there,
    In order to configure the JMS sender-adapter with EOIO QoS, I need to provide 2 "extra" parameters. These are
    1)Queue ID
    2)Processing J2EE Cluster Server (ClusterID)
    So far I was able to find out the name of the ClusterId in our system but for the Queue ID I still have some doubts.
    From the XI documentation I understand that for QoS EOIO , all messages share the same queue. They also say; <i>The "suffix" of this queue must be explicitly set in the application program by a <u>serialization context</u> before the client proxy is called.</i> What exactly is <i>serialization-context</i> in this context?
    Can someone provide me with a clear explanation which steps I need to follow in order to use the functionality of QoS EOIO? And if possible some example of the name of an EOIO queue?
    Thanks,
    R.

    Hi Roberto,
    For queue ID, you can specify any arbitrary queue ID for example, POQueue1, jayqueue or salesorder...
    It can be anything you want and no additional configuration is needed.  Just specify any name you like to use for queue ID and you are all set.
    Thanks,
    Jay

  • How to configure the jms adapter

    hi all,
           i got some trouble trying to configure de JMS adapter, i 'd be glad if some colud give me a hand with this. i'am wordering if there is a complete document about this topic to help me out with de configuration.
    thk u all very much.
    Regards, Pablo

    Hi,
    The below URL will help you to understand what is JMS, how to configure and do a testing.
    http://learn-oraclesoa.blogspot.co.uk/2013/04/oracle-jms-adapter-tutorial.html
    Below will help you to configure the JNDI for JMS
    http://manojm-nair.blogspot.co.uk/2013/02/configuring-connection-jndis-for-jms_13.html
    Thanks,
    Vijay

  • How to access the JMS queues in the XI J2EE Engine?

    Hi Gurus,
    Can anybody know how to access the jms dead message queues in the WAS J2EE Engine?
    I have read in the SAP documentation that we can use some JMS commands from the telnet. I don't know how to use those commands.
    Can anybody provide a step-by-step process to access these queues?
    Thanks
    Kalyan

    1) Open a command prompt
    2) type
    telnet localhost 50008
    where the port is the same as your http, but with 8 as last digit.
    3) Login
    4) Issue the following set of commands
            jump 0
            add jms
            jms list deadmsgs
    Check by man jms other possible options.
    HTH
    Peter

  • How to check the jms Queue is persistance or not in jboss application serve

    hi,
    i am using jboss as application server for jms and database is postgres.For an message store i am using the "*database store*".while starting the jms adding queue it is adding the messages to the jms queue after starting the jms receiver the datas are received sucessfully....afte some 10 to 13 hours i am getting java.lang.OutOfMemoryError in jms..so i checked the postgres table space.Table space is increased gradually...I think that the after receiver received that message the messages are not deleted in the database.how to debugg the the secnario in jboss as wel as in database.....how to chaeck the queue is in persistance or not persistance...
    regards.
    naresh govindaswamy.

    Send a request to the server somehow, so that the server is aware of this. AJAX may be very useful in this if you want to do this asynchronously.
    its very urgently This is irrelevant information. That's your problem. We don't care less or more. Some users here will even refuse to help you if you're putting pressure.

  • How can  SAP XI JMS Queue communicate with external JMS Queue

    Dear All ,
    we are Implementing SAP XI . Sender business system is splitting a file into small files and keeping them into JMS queues we want SAP XI JMS queue should communicate directly with the sender JMS queue (which is an external JMS queue) without any Adapter ,programming efforts and Middleware.
    Can you please tell me is it possible?

    I dont think it is possible directly without adapter

  • How to configure appli specific Queue & Topics in destinations-service.xml

    Hello All,
    I am trying to configure JBoss Messaging 1.4.5GA in JBoss-4.3.0 (Enterprie Edition).
    I am Configuring my application specific Queue and Topics in destinations-service.xml , but Queue is not getting register in jboss.
    I am getting following error in jboss :
    [ServiceConfigurator] Problem configuring service jboss.messaging.destination:service=Queue,name=jms/servers/logmon/MonitorInQueue
    org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute@1e32382 on mbean jboss.messaging.destination:service=Queue,name=jms/servers/logmon/MonitorInQueue; - nested throwable: (javax.management.AttributeNotFoundException: not found: DestinationManager)
    at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:698)
    at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:380)
    at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
    at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
    at org.jboss.system.ServiceController.install(ServiceController.java:226)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    My destinations-service.xml is unsder "jboss-4.3.0\server\MySiteServer\deploy\jboss-messaging.sar" , not in deploy directory of jboss.
    Is it right plcae to configure destination queue and topics ??
    My destinations-service.xml is like given below :
    <?xml version="1.0" encoding="UTF-8"?>
    <server>
    <mbean code="org.jboss.jms.server.destination.QueueService"
    name="jboss.messaging.destination:service=Queue,name=jms/servers/logmon/MonitorInQueue"
    xmbean-dd="xmdesc/Queue-xmbean.xml"> ( what is this line for ??)
    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
    <depends>jboss.messaging:service=PostOffice</depends>
    <depends optional-attribute-name="DestinationManager">jboss.messaging:service=DestinationManager</depends>
    <depends optional-attribute-name="SecurityManager">jboss.messaging:service=SecurityManager</depends>
    <attribute name="SecurityConf">
    <security>
    <role name="guest" read="true" write="true"/>
    <role name="publisher" read="true" write="true" create="false"/>
    <role name="noacc" read="false" write="false" create="false"/>
    </security>
    </attribute>
    </mbean>
    </server>
    Please help me in configuring DestinationManager and SecurityManager also !!!
    You can view attached destinations-service.xml.
    Thanks in advance for your efforts to resolve my problem, Thanks !!!
    Regards,
    Rahul Aahir
    mailme :[email protected]
    Attachments:
    destinations-service.xml (20.2 K)
    Edited by: Rahul_Aahir9885 on Sep 16, 2010 9:31 AM

    Unless there happen to be any JBoss experts reading this, you may have more success asking your question in a JBoss-specific forum.

Maybe you are looking for