Package javax.jms

Examples of javax.jms.Message


    super(pJDBC, pDBUser, pDBPass, pQueueName);
  }
 
  public void Receive()
  {
    Message JmsMsg;
    Log4jMsg Log4jMsg;
   
    if (dbConn.connected == false)
    {
      logger.fatal("Connection not established - Impossible to receive");
View Full Code Here


    super(pJDBC, pDBUser, pDBPass, pQueueName);
  }
 
  public void Receive()
  {
    Message JmsMsg;
    Log4jMsg Log4jMsg;
   
    if (dbConn.connected == false)
    {
      logger.fatal("Connection not established - Impossible to receive");
View Full Code Here

    ictx.close();

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageConsumer recv = sess.createConsumer(queue);
    Message msg;

    cnx.start();

    msg = recv.receive();
     
    String u = msg.getStringProperty("url");
    System.out.println("url = " + u);
    System.out.println("crc=" + msg.getLongProperty("crc"));
    System.out.println("ack=" + msg.getBooleanProperty("ack"));
   
    long diff = System.currentTimeMillis() - msg.getLongProperty("date");
    System.out.println("time = " + diff);
   
    System.out.println();
    System.out.println("messages received.");
View Full Code Here

    Connection cnx = cf.createConnection();
    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = sess.createProducer(null);

    Message msg = sess.createMessage();
    msg.setStringProperty("expiration", "0");
    msg.setStringProperty("persistent", "true");
    msg.setStringProperty("acquisition.period", "30000");
    msg.setStringProperty("collector.url", "http://www.gnu.org/licenses/lgpl-3.0.txt");
    msg.setStringProperty("collector.type", "5");
    producer.send(queue, msg);
//    producer.send(topic, msg);

    System.out.println("messages sent.");
View Full Code Here

    Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer prod = sess.createProducer(queue);
    MessageConsumer cons = sess.createConsumer(queue);
    cnx.start();

    Message msg1 = sess.createMessage();
    msg1.setStringProperty("Joram#0:type=Destination,name=*",
                           "NbMsgsReceiveSinceCreation,NbMsgsSentToDMQSinceCreation");
    prod.send(msg1);
    System.out.println(" --> Monitoring message sent: " + msg1.getJMSMessageID());
   
    Message msg2 = cons.receive();
   
    System.out.println(" --> Monitoring message received: " + msg2.getJMSMessageID());
    try {
      Monitor.doReport(msg2);
    } catch (JMSException exc) {
      exc.printStackTrace();
    }
View Full Code Here

  public void run() {
    try {
      start();
      while (this.running) {
        Message clientMessage = this.consumer.receive();
        if (clientMessage != null) {
          Object object = readMessage(clientMessage);
          String selector = readSelector(clientMessage);
          this.handler.messageReceived(this.session, object, this.responseQueue, selector);
        }
View Full Code Here

     *            the RemoteInvocationResult object
     * @throws javax.jms.JMSException
     *             if thrown by trying to send the message
     */
    protected void writeRemoteInvocationResult(final Message message, final RemoteInvocationResult result) throws JMSException {
        Message responseMessage = createResponseMessage(producer.getSession(), message, result);
        producer.getMessageProducer().send(message.getJMSReplyTo(), responseMessage);
    }
View Full Code Here

        // though some JMS providers, like ActiveMQ, might do this kind of thing for us under the covers
        if (result == null) {
            throw new IllegalArgumentException("result cannot be null");
        }
       
        Message answer = getMarshaller().createResponseMessage(session, result, message);
       
        // lets preserve the correlation ID
        answer.setJMSCorrelationID(message.getJMSCorrelationID());
        return answer;
    }
View Full Code Here

    public void setConnectionFactory(ConnectionFactory connectionFactory) {
        this.connectionFactory = connectionFactory;
    }

    protected void writeRemoteInvocationResult(Message message, RemoteInvocationResult result) throws JMSException {
        Message responseMessage = createResponseMessage(producer.getSession(), message, result);
        producer.getMessageProducer().send(message.getJMSReplyTo(), responseMessage);
    }
View Full Code Here

        }
        LingoInvocation invocation = (LingoInvocation) createRemoteInvocation(methodInvocation);
        MethodMetadata metadata = invocation.getMetadata();
        replaceRemoteReferences(invocation, metadata);
        try {
            Message requestMessage = marshaller.createRequestMessage(requestor, invocation);
            populateHeaders(requestMessage);
            if (metadata.isOneWay()) {
                requestor.oneWay(destination, requestMessage);
                return null;
            }
            else {
                Message response = requestor.request(destination, requestMessage);
                RemoteInvocationResult result = marshaller.extractInvocationResult(response);
                return recreateRemoteInvocationResult(result);
            }
        }
        catch (JMSException ex) {
View Full Code Here

TOP

Related Classes of javax.jms.Message

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.