JMS Control to receive a message
Hi all,
I’m trying to createJMS Contro to test my JMS Server. A method to send a message was generated
@Message(JMSControl.MessageType.Auto)
public void sendMessage(Object body);but I cannot find how can I write a method to receive a message.
Can anybody tell me how can I receive messages from JMS server with JMS Control?
Many thanks
Pavel
It is possible till 8.1, but not from 9.2 versions. The suggested way to implement this for 9.2 or greater is:
In version 9.2, a JMS control can't be used to receive messages. In upgraded code, you can work around this by developing a message-driven bean (MDB) to receive the messages or by invoking a web service using asynchronous request-response.
Please refer this upgrade guide:
http://e-docs.bea.com/workshop/docs92/ws_platform/upgrading/conChangesDuringUpgrade.html#features_not_supported
regards,
~Poorna
Similar Messages
-
JMS - How to receive specific messages (by time stamp)
Hi,
I need to receive messages from a queue, but only ones that were sent in a specific time stamp (e.g. more than ten minutes ago).
i have the methods receive or receiveNoWait, but I dont know how to filter the messages according to the time they were posted.
(I dont want to receive all the messages or the next message in the queue, instead, i want to empty all the old messages from the queue and leave only the new ones.)
How do I do that?
Thanks,
RuvikHi Ruvika,
Do you want the messages older than 10mins to be discarded? If you want only message which are there for less than 10mins then you can probably use one of these methods
For QueueSender:
send(Message message, int deliveryMode, int priority, long timeToLive)
or
For TopicPublisher:
publish(Message message,int deliveryMode,int priority, long timeToLive)
The timeToLive is in milliseconds. After that the message should be discarded by the provider.
Check out the JMS API documentation for more details.
Have fun!!!
Robo -
JMS Client can not receive a message
Hi,
after migration from SAP XI 3.0 to SAP PI 7.1, it is not possible that our jms-client can receive a message from a queue of the sap jms-provider.
but the send-process of a message in a queue works fine.
So what is different when you compare the jms-provider of SAP XI 3.0 and SAP PI 7.1?
Perhaps, the selector has changes?
Can anybody help me please?
Regards
StefanDeadcowboy wrote:
My ISP is Cox Communications, I have checked all the folders in web mail also, and She is not getting any bounced message saying the message was not sent.
That's who I have and have found quite a bit of email in their online spam folder. But, if it is not there, something is blocking it--either at her end or yours.
Cox now supports IMAP, so you can actually map their Spam folder to Junk in Mail--and gain the other benefits of IMAP over POP. -
JMS Control - receive-correlation-property
Hi,
I am using JMS Control in WLI 8.1. This is not a WLI JMS Control. Some application
puts a message to Weblogic Queue.
My JMS Control is subscribed to the queue. It gives the following error - when
it receives the message...
<Jun 15, 2004 4:02:56 PM EDT> <Error> <WLW> <000000> <Received message without
correlation
ID. MessageID=ID:P<323523.1087329776527.0>>
I am new to this domain. I looked at the receive-correlation-property in my JMS
control, which is defaulted to JMSCorrelationID. Really appreciate Any suggestions/thoughts.
TIA,
DonHi,
I am using JMS Control in WLI 8.1. This is not a WLI JMS Control. Some application
puts a message to Weblogic Queue.
My JMS Control is subscribed to the queue. It gives the following error - when
it receives the message...
<Jun 15, 2004 4:02:56 PM EDT> <Error> <WLW> <000000> <Received message without
correlation
ID. MessageID=ID:P<323523.1087329776527.0>>
I am new to this domain. I looked at the receive-correlation-property in my JMS
control, which is defaulted to JMSCorrelationID. Really appreciate Any suggestions/thoughts.
TIA,
Don -
Hallo, I have an application which implements asynch communication between the web and business layer using JMS.
On a page a user can upload files, which are processed by the backend. For large files this can be a long running process, thats why we use JMS to send the file asynchronously and use JMS to update progress information on the page.
The application works fine on JBoss 6 with HornetMQ.
After porting to Weblogic I see consistently a strange phenomenon. The update messages from the processing backend logic are send as expected. But the receiver does not receive one message after another but receives all the messsages almost at once after only the producer has sent the last message.
For me this is totally unexpected behavior and of course our progress bar on the page does not work properly, but merely jumps from 0 to 100% after the data has been processed.
It looks like the consumer waits until the producer has finished its transaction. But how can this be possibly? I have learned that transaction never span producer - messagesystem - consumer.
Example Code:
Producer:
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import org.apache.log4j.Logger;
import com.sun.tools.ws.wsdl.document.jaxws.Exception;
import dsde.core.aspects.DsdeException;
import dsde.core.aspects.ExceptionHandler;
import dsde.core.entity.Data;
@Stateless
@Interceptors(ExceptionHandler.class)
public class ParserBean implements Parser {
private Logger log = Logger.getLogger(this.getClass());
@EJB
private DataDAO dataDAO;
//Weblogic
@Resource(mappedName="jms.BackQueue")
//Jboss
//@Resource(mappedName="queue/dsdeBackQueue")
private Destination backQueue;
//Weblogic
@Resource(mappedName="jms.dsdeConnectionFactory")
//JBoss
//@Resource(mappedName="XAConnectionFactory")
private ConnectionFactory connectionFactory;
private Connection connection;
@Override
public void parse(String text, String description, String sessionId) throws DsdeException{
double percentDone = 0;
double j = 0.0;
//Simuliere was langdauerndes, schwieriges
for (int i=0; i < text.length(); i++) {
j = i;
percentDone = j / text.length() * 100;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
log.error(e);
if (i % 2 == 0) {
//periodisch das Frontend mit dem Fortschritt updaten
sendFeedback((int)percentDone, sessionId);
//Zum Schluss noch senden dass wir fertig sind
//Sonst wird der Send Button nicht wieder aktiv
percentDone=100;
sendFeedback((int)percentDone, sessionId);
//Jetzt wird noch richtig geparsed :-)
String[] words = text.split(" ");
//Entity konstruieren
Data data = new Data(description, words);
//Das Ergebnis in die Datenbank schreiben
dataDAO.saveData(data);
private void sendFeedback(int percentDone, String sessionId) {
Session session = null;
try {
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(backQueue);
producer.setTimeToLive(50000);
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
TextMessage message = session.createTextMessage();
message.setJMSCorrelationID(sessionId);
message.setText("" + percentDone);
producer.send(message);
log.info("ParserBean has sent " + percentDone);
} catch (JMSException e) {
log.error(e);
} finally {
if (session != null) {
try {
session.close();
} catch (JMSException e) {
log.error(e);
@PostConstruct
public void init(){
try {
connection = connectionFactory.createConnection();
} catch (JMSException e) {
log.error(e);
@PreDestroy
public void close() {
try {
connection.close();
} catch (JMSException e) {
log.error(e);
}Consumer:
import javax.annotation.ManagedBean;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
@ManagedBean
@SessionScoped
public class FeedbackReceiverBean implements MessageListener {
private Logger log = Logger.getLogger(this.getClass());
//jndi names of managed objects
private String connectionFactoryName;
private String queueName;
private Connection connection;
private Session session;
private int percent;
private boolean disabled;
public boolean isDisabled() {
return disabled;
public void setDisabled(boolean disabled) {
this.disabled = disabled;
public int getPercent() {
return percent;
public void setPercent(int percent) {
this.percent = percent;
public void setConnectionFactoryName(String connectionFactoryName) {
this.connectionFactoryName = connectionFactoryName;
public void setQueueName(String queueName) {
this.queueName = queueName;
@PostConstruct
public void init() throws NamingException, JMSException {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpSession httpSession = (HttpSession) facesContext.getExternalContext().getSession(false);
String sessionId = httpSession.getId();
Context context = new InitialContext();
ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup(this.connectionFactoryName);
Queue queue = (Queue) context.lookup(this.queueName);
this.connection = connectionFactory.createConnection();
this.session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
String filter = "JMSCorrelationID = '" + sessionId + "'";
MessageConsumer consumer = session.createConsumer(queue, filter);
consumer.setMessageListener(this);
connection.start();
@PreDestroy
public void close() throws JMSException {
this.session.close();
this.connection.close();
@Override
public void onMessage(Message message) {
if (message instanceof TextMessage) {
TextMessage textMessage = (TextMessage) message;
try {
this.percent = Integer.parseInt(textMessage.getText());
if (percent >= 100) {
this.disabled = false;
log.info("Prozent " + percent);
} catch (JMSException e) {
log.error(e);
else {
log.error(message.toString() + " is no TextMessage");
public void disable() {
this.disabled = true;
}Configuration:
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-jms xmlns="http://xmlns.oracle.com/weblogic/weblogic-jms" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-jms http://xmlns.oracle.com/weblogic/weblogic-jms/1.1/weblogic-jms.xsd">
<connection-factory name="dsdeConnectionFcatory">
<default-targeting-enabled>true</default-targeting-enabled>
<jndi-name>jms/dsdeConnectionFactory</jndi-name>
<default-delivery-params>
<default-delivery-mode>Persistent</default-delivery-mode>
<default-time-to-deliver>0</default-time-to-deliver>
<default-time-to-live>100</default-time-to-live>
<default-priority>4</default-priority>
<default-redelivery-delay>0</default-redelivery-delay>
<send-timeout>10</send-timeout>
<default-compression-threshold>2147483647</default-compression-threshold>
</default-delivery-params>
<client-params>
<client-id-policy>Restricted</client-id-policy>
<subscription-sharing-policy>Exclusive</subscription-sharing-policy>
<messages-maximum>10</messages-maximum>
</client-params>
<transaction-params>
<xa-connection-factory-enabled>true</xa-connection-factory-enabled>
</transaction-params>
<security-params>
<attach-jmsx-user-id>false</attach-jmsx-user-id>
</security-params>
</connection-factory>
<queue name="dsdeQueue">
<sub-deployment-name>dsdeQueue</sub-deployment-name>
<jndi-name>jms/dsdeQueue</jndi-name>
</queue>
<queue name="dsdeFeedbackQueue">
<sub-deployment-name>dsdeFeedbackQueue</sub-deployment-name>
<jndi-name>jms/dsdeFeedbackQueue</jndi-name>
</queue>
<queue name="dsdeBackQueue">
<sub-deployment-name>dsdeBackQueue</sub-deployment-name>
<jndi-name>jms/BackQueue</jndi-name>
</queue>
</weblogic-jms>Any help would be greatly appreciated.
Thanks,
HansThanks for posting your analysis!
I think your solution is probably best.
FYI: Your JMS session was never a "transacted" session. It's definitely confusing, but the term "transacted session" has a special meaning in JMS, it actually refers to a session that is not XA/JTA aware and instead maintains an internal local transaction that's scoped only to the current JMS session's operations. A transacted session is created by passing "true" to the first parameter of createSession, and such a session's local transaction is committed by calling session.commit() (which starts a new transaction). To further add to the confusion, I think that JEE servers are actually obligated to ignore requests to set the transacted flag to true -- WebLogic does this trick by secretly wrapping access to the JMS API when applications lookup JMS connection factories via a resource reference.
Regards,
Tom -
Usage of Apache Beehive JMS control inside Message Driven Bean
Hi,
I am developing a j2ee application using weblogic workshop 10.3. This application contains the following three projects.
- J2EE Utility Project
- Message Driven Bean Project
- Ear Project
In the Utility project I have created one apache beehive jms control. I am using this control inside the message driven bean application. I haven't got any issues during the development and deployment phase with the beehive control. But during runtime the apache beehive jms control is not getting instantiated and the mdb application is throwing the null pointer exception when the EJB container try to execute the methods on the control instance. I have used the declarative programming model to create the control instance inside the mdb application.
I am using the weblogic 10.3 server for testing and I have created the 10.3 weblogic+workshop domain. By default it has the beehive libraries deployed.
Can somebody help me out to resolve this issue?
Regards,
BpYou can get the message directly with getText() method. Following is the snippet of code.
if (aMsg instanceof TextMessage) {
TextMessage msg = (TextMessage) aMsg;
String testMessage = msg.getText());
Kishore. -
Receive asynchronous message from JMS topic over web service
Hi,
I have a JMS topic and I want to expose it as a web service so that clients can
make durable subcription to the topic and receive messages asynchronously. What
is the best way of doing this ? Is there a portable (to other containers) way
of do this ? If not, is there a web logic specific way of doing this ?
Thanks,
SivaSo you expect clients to be receiving SOAP messages over HTTP? In this
case, the clients are really servers that are capable of servicing SOAP
requests, correct? And how about the senders: are they also using
SOAP/HTTP to send messages that are delivered to the receivers?
It should be possible to write this yourself using JMS not as the
transport, but as a mechanism for distributing the message to a set of
clients. You'll need to implement a Web Service for publishing to a
topic, an operation for registering an end point to recieve messages,
and an MDB (or other form of JMS subscriber) executing on the server to
relay the message to the end point.
Siva wrote:
Hi,
I have a JMS topic and I want to expose it as a web service so that clients can
make durable subcription to the topic and receive messages asynchronously. What
is the best way of doing this ? Is there a portable (to other containers) way
of do this ? If not, is there a web logic specific way of doing this ?
Thanks,
Siva -
Receiving all messages including old ones from a JMS Topic
Hi all,
is there a way for a subscriber to receive all messages available in a Topic including the "old" ones?
By the "old" messages I mean messages written in the Topic before the subscriber really subscribes or messages created oven before the subcrieber exist.
What is the best solution for this? Are there any?
Many thanks,
Nelson.Hi Nelson,
Any mechanism for reprocessing messages is up to your JMS provider. If I may plug DropboxMQ, it has a simple but effective mechanism to do exactly as you wish. With DropboxMQ every messages is a file. Redelivery is as simple as moving messages from one directory to another. Here is the link:
[http://dropboxmq.sourceforge.net]
Cheers,
Dwayne -
JMS consumer is not receiving any messages. am i missing something ?
Hi bellow is the consumer code, my consumer is not receiving any messages even though there are messages in the queue. I have tried to debug the code. but the consumer is not calling the onMessage() method even though there are messages in the queue. Please guide me on the same. if i am missing something.
package org.icrm.cons;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Session;
import javax.jms.TextMessage;
import org.apache.activemq.ActiveMQConnectionFactory;
public class JConsumer implements ExceptionListener,MessageListener{
public static void main(String[] args){
JConsumer consumer = new JConsumer();
System.out.println("here 1");
consumer.consumeMessage("MyQueue");
public void consumeMessage(String queueName){
try{
System.out.println("here 2");
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
Connection connection = connectionFactory.createConnection();
connection.start();
connection.setExceptionListener(this);
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destination = session.createQueue(queueName);
MessageConsumer consumer = session.createConsumer(destination);
//ASync
consumer.setMessageListener(this);
//Sync
/*Message message = consumer.receive(1000);
TextMessage textMessage = (TextMessage)message;
String text = textMessage.getText();
System.out.println("Received : " + text);
consumer.close();
session.close();
connection.close();
}catch(Exception e){
System.out.println("Caught: " + e);
e.printStackTrace();
public void onException(JMSException arg0) {
System.out.println("JMS Exception occured. Shutting down client.");
public void onMessage(Message message) {
try{
TextMessage textMessage = (TextMessage)message;
String text = textMessage.getText();
System.out.println("Received: " + text);
}catch(JMSException e){
e.printStackTrace();
}Hey,
I commented the following line of code. and i got all the messages.
//consumer.close();
//session.close();
//connection.close();but then when should i close the consumer, session and connection object ??? -
When i attempt to download the icloud control panel, I receive a message that states, "this program is not normally downloaded andmay damage yourcomputer". What shouldI do?
cbherbWell thanks for the star but I would still like to see the exact error?
-
Example of Weblogic Appserver using XA Controlled Transaction to send messages to third party JMS
I am looking for Example of Weblogic Appserver using XA Controlled Transaction
to send messages to third party JMS Server.
I want to send messages to JMS and use Weblogic MDB to consume that message and
send it to some third party JMS in a XA Controlled transaction.
Sure. Right now, it involves a bit of JTA programming -- in our next
release, it should be easier, however.
Before sending a message, you have to:
-- Use the TxHelper class to get the current Transaction object.
-- Use the "getXAResource" method on the JMS provider's Session object to
get the XAResource object for the JMS Session you're using to send.
-- Call "enlistResource" on the Transaction object.
You MUST do this in every transaction where you use the JMS provider to send
a message.
You can find the documentation for the TxHelper class and other
WebLogic-specific classes here:
http://e-docs.bea.com/wls/docs70/javadocs/index.html
Look for the "weblogic.transaction" package.
You can find documentation for the Transaction class (which defines
enlistResource) and other classes here:
http://java.sun.com/products/jta/javadocs-1.0.1/index.html
You should also use the weblogic.transaction.TransactionManager class and
call "registerDynamicResource" once (and only once) in your application to
register the JMS providers XAResource with JTA. This makes JTA more
efficient, and it makes transaction recovery work properly.
If the JMS provider is MQ, then look at the whitepaper "Using JTA
transactions to envelope WLS JMS and IBM MQSeries" here:
http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
And finally, if you have more questions, the transaction people will be able
to help more. Post to "weblogic.developer.interest.transaction".
greg
"Neeru Munjal" <[email protected]> wrote in message
news:[email protected]...
>
> I am looking for Example of Weblogic Appserver using XA Controlled
Transaction
> to send messages to third party JMS Server.
> I want to send messages to JMS and use Weblogic MDB to consume that
message and
> send it to some third party JMS in a XA Controlled transaction.
>
-
I run Windows XPSP2, my ISP is BT Broadband, security suite is BT NetProtect Plus which is essentially a McAfee product. I am having trouble with a printer connection - when I turn it on I receive a message "USB Device not recognised". I have done usual things turned off, unplugged, replugged with identical lead that is known to be OK, uninstalled software and tried to reinstall from CD (cannot complete as message recived again as oon as I turn on printer). Final solution is to click on this message as it advises to obtain USB troubleshooting advice from Microsoft Help and Support Centre. This is when I get message in my original question which prevents me going further. I have accessed Windows/Contol Panel/Internet/Security and set level to medium but this makes no difference. Contacting my ISP, I was told this was an incompatibility issue with Mozilla. If so I have no way of finding out what my connection problem is.
ActiveX is an Internet Explorer plugin system and will not work on Firefox or many other browsers. To use ActiveX you will need to use Internet Explorer.
-
Hi,
I want to publish a message to a message queue using JMS control in
pageflow. The JMS control is configured properly, it has set
connection-factory-jndi-name, send-type and send-jndi-name.
Receive-jndi-name is not set because the control doesn't consume messages.
In pageflow, there is an action containing code:
//create message
Message message = myJMSControl.getSession().createTextMessage("some text");
//send message
myJMSControl.sendJMSMessage(message);
In runtime I get an exception when creating a message:
weblogic.jms.common.IllegalStateException: Session is closed
at weblogic.jms.client.JMSSession.checkClosed(JMSSession.java:2729)
at weblogic.jms.client.JMSSession.createMessage(JMSSession.java:548)
at Controller.startPeriod(Controller.jpf:90)
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:324)
at
com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.
java:1262)
at
com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowControl
ler.java:1214)
Am I doing something wrong? Is there any other way how to create a message?
I wrote a standalone test client which publish a message to the same queue
using the same factory. All goes well. The code is:
ctx = new InitialContext(env);
qConFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qCon = qconFactory.createQueueConnection();
qSession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE);
qSender = qSession.createSender(queue);
msg = qSession.createTextMessage("some text");
qcon.start();
qsender.send(msg, DeliveryMode.PERSISTENT, priority, ttl);
Thanks for advice,
TomasTomas,
This seems like an issue. The error does not happen when you use the same
code in a WebService. This also does not happen for a JMSControl which
accepts a TextMessage such as
myJMSControl.sendTextMessage("tomas");
I will file a change request for this.
Thanks for the feedback.
Regards,
Anurag
"Tomas Koutny" <[email protected]> wrote in message
news:[email protected]...
Hi,
I want to publish a message to a message queue using JMS control in
pageflow. The JMS control is configured properly, it has set
connection-factory-jndi-name, send-type and send-jndi-name.
Receive-jndi-name is not set because the control doesn't consume messages.
In pageflow, there is an action containing code:
//create message
Message message = myJMSControl.getSession().createTextMessage("sometext");
//send message
myJMSControl.sendJMSMessage(message);
In runtime I get an exception when creating a message:
weblogic.jms.common.IllegalStateException: Session is closed
atweblogic.jms.client.JMSSession.checkClosed(JMSSession.java:2729)
atweblogic.jms.client.JMSSession.createMessage(JMSSession.java:548)
at Controller.startPeriod(Controller.jpf:90)
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:324)
at
com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.
java:1262)
at
com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowControl
ler.java:1214)
Am I doing something wrong? Is there any other way how to create amessage?
>
>
I wrote a standalone test client which publish a message to the same queue
using the same factory. All goes well. The code is:
ctx = new InitialContext(env);
qConFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
qCon = qconFactory.createQueueConnection();
qSession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE);
qSender = qSession.createSender(queue);
msg = qSession.createTextMessage("some text");
qcon.start();
qsender.send(msg, DeliveryMode.PERSISTENT, priority, ttl);
Thanks for advice,
Tomas -
Platform Domain and WorkShop JMS Control Problems
I created a platform domain and created a workflow in WLI. I would like to expose
the workflow from a web service. I successfully used the JMS control to send
the XML request into WLI and receive the reply from WLI. My problem is whenever
I try to execute the callback function when I receive my reply from JMS it his
a loop and never executes the callback to the client. In the same service i replaced
the JMS interaction with a timer and it works fine. The problem only occurrs when
the JMS control receives the reply and then invokes the callback. If I just receive
the reply without calling the callback everything works fine. Any ideas? ThanksI did a little more debugging and it looks like when the message is sent to the
JMS Queue a different instance of the session EJB is calledback to when the JMS
reply is received. I noticed when my callback is invoked by JMS i have different
proxy and context objects. I hope this helps.
"David" <[email protected]> wrote:
>
I created a platform domain and created a workflow in WLI. I would like
to expose
the workflow from a web service. I successfully used the JMS control
to send
the XML request into WLI and receive the reply from WLI. My problem is
whenever
I try to execute the callback function when I receive my reply from JMS
it his
a loop and never executes the callback to the client. In the same service
i replaced
the JMS interaction with a timer and it works fine. The problem only
occurrs when
the JMS control receives the reply and then invokes the callback. If
I just receive
the reply without calling the callback everything works fine. Any ideas?
Thanks -
How to maintainCorrelation using JMS control
Hi I am sending and receiving message from differnt Queue in WLI.Using JMS Control how we maintain correlation. Even though it is a asyncroneous communication I want the reply back for further process in JPD. I try it out it shouws the below error message.
<5/07/2007 12:11:00 PM EST> <Error> <WLW> <000000> <errMsg=onMessage(): Could no
t deliver message with id=ID:P<851933.1183516529000.0> to Service[jms://TES33269
5:8001/weblogic.jws.jms.QueueConnectionFactory/jws.queue?URI=/TestWSAccess/proce
sses/process.jpd(1183516524671):a:AmadausMsgChannel:listener].
I receive the response upto the Queue. I couldn;t get it back to my jpd.
Regards
AshokHi I am sending and receiving message from differnt
Queue in WLI.Using JMS Control how we maintain
correlation. Even though it is a asyncroneous
communication I want the reply back for further
process in JPD. I try it out it shouws the below
error message.
<5/07/2007 12:11:00 PM EST> <Error> <WLW> <000000>
<errMsg=onMessage(): Could no
t deliver message with
id=ID:P<851933.1183516529000.0> to
Service[jms://TES33269
5:8001/weblogic.jws.jms.QueueConnectionFactory/jws.que
ue?URI=/TestWSAccess/proce
sses/process.jpd(1183516524671):a:AmadausMsgChannel:li
stener].
I receive the response upto the Queue. I couldn;t get
it back to my jpd.
Regards
AshokH! Ashok
May be following info may help you establishing Co-relation
Two-way messaging requires that every received messages be correlated with the instance of the application that sent the original outgoing message. This correlation is typically managed for you by the JMS control, so no action is necessary on your part. To learn more about message correlation, see the explanation of the send-correlation-property and receive-correlation-property attributes for the @jc:jms annotation.
To enable two-way messaging with queues:
1.
On the JMS control, specify the name of the JMS queue to which you want to send messages by setting the value of the send-jndi-name attribute on the @jc:jms annotation.
Specify the name of the JMS queue from which you want to receive messages by setting the value of the receive-jndi-name attribute on the @jc:jms annotation.
To send a message from your web service, call the JMS control's default method (sendTextMessage, sendBytesMessage, sendObjectMessage or sendJMSMessage depending on the message type selected when the control was created), or a custom method you have defined for the JMS control.
4.
To be notified when messages are received on the receive queue, implement a callback handler for the JMS control?s callback (receiveTextMessage, receiveBytesMessage, receiveObjectMessage or receiveJMSMessage depending on the message type selected when the control was created), or a custom callback you have defined for the JMS control.
The following is an example enabling two-way messaging:
public class MyService {
* @common:control
private MyQueueControl myQueue;
* @common:operation
public void sendID(String personID) throws Exception
myQueue.sendTextMessage( personID );
myQueue_receiveTextMessage(String message)
// message has arrived from queue, perform desired operations
Maybe you are looking for
-
Where to store movies ? in the iPhoto Library or the iMovie Library
Hi, I never had a digital video camera. All my video footage has been shot with my photo cameras. I started with very few clips, never really used iMovie and was most of the time a happy camper with iPhoto. As the photos and the video clips were and
-
Values not updating in Condition records
Hi All, Small question for you all - We have a condition record for TAX (ZVAT) this has three access sequences on it, one of these feilds for access is the HT (OIHANTYP), Nowe the problem is when HT = 01 then Vat should be calculated at the correct r
-
Selecting tunes from initial to end of list...how
How do you select from a certain tune in the list of music to the end of the list? I am currently clicking on the initial tune, holding down shift and using the down arrow key. I don't see how to click on initial and 'jump' to end selecting them from
-
Forms Builder - Want to use Clipboard
Form builder - developer 2000 I am writing a program which should check weather there is something in clipboard . as soon as something comes to clipboard the trigger should be fired . Is there any trigger which will get fired as soon as something add
-
I have tick the options - do not allow pop up ads. But is still appears allot. It makes working on web imposssible. I do not want to see the ads or want it to open in new windows. I do not want then at all!!!! please assist urgently