Package javax.jms

Examples of javax.jms.QueueSession.createSender()


            } else {
                conn = factory.createQueueConnection();
            }
            final QueueSession sess = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            final Queue queue = (Queue) lookup(context, queueBindingName);
            final QueueSender sender = sess.createSender(queue);
            conn.start();
            return new QueueInfo(conn, sess, sender);
        } catch (final NamingException ex) {
            LOGGER.warn("Unable to locate connection factory " + factoryBindingName, ex);
            if (!suppress) {
View Full Code Here


         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createSender " + session + " queue=" + queue);
         }

         QueueSender result = session.createSender(queue);
         result = new HornetQRAQueueSender(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdSender " + session + " sender=" + result);
View Full Code Here

                        e.printStackTrace();
                    }
                }
            });

            QueueSender sender = session.createSender(queue);
            for (int i = 0 ; i < 10 ; i++) {
                String s = "Test" + i;
                TextMessage msg = session.createTextMessage(s);
                sender.send(msg);
            }
View Full Code Here

        ReceiverComponent receiver = new ReceiverComponent();
        container.activateComponent(receiver, "receiver");

        QueueConnection qConn = connectionFactory.createQueueConnection();
        QueueSession qSess = qConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueSender qSender = qSess.createSender(queue);
        TextMessage message = qSess.createTextMessage("<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello>world</hello>");
        qSender.send(message);

        receiver.getMessageList().assertMessagesReceived(1);
        List msgs = receiver.getMessageList().flushMessages();
View Full Code Here

        protected SendSession createSendSession(javax.jms.Connection connection)
            throws JMSException
        {
            QueueSession session = createQueueSession((QueueConnection)connection,
                                        JMSConstants.DEFAULT_ACKNOWLEDGE_MODE);
            QueueSender sender = session.createSender(null);
            return new QueueSendSession(session, sender);
        }

        private final class QueueSendSession extends SendSession
        {
View Full Code Here

      session = connection.createQueueSession( false, QueueSession.AUTO_ACKNOWLEDGE );
      ObjectMessage message = session.createObjectMessage();
      message.setObject( data );
      message.setStringProperty( INDEX_NAME_JMS_PROPERTY, indexName );

      sender = session.createSender( processor.getJmsQueue() );
      sender.send( message );

      session.close();
    }
    catch (JMSException e) {
View Full Code Here

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createSender " + session + " queue=" + queue);
         }

         QueueSender result = session.createSender(queue);
         result = new HornetQRAQueueSender(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdSender " + session + " sender=" + result);
View Full Code Here

      session = connection.createQueueSession( false, QueueSession.AUTO_ACKNOWLEDGE );
      ObjectMessage message = session.createObjectMessage();
      message.setObject( data );
      message.setStringProperty( Environment.INDEX_NAME_JMS_PROPERTY, indexName );

      sender = session.createSender( processor.getJmsQueue() );
      sender.send( message );

      session.close();
    }
    catch (JMSException e) {
View Full Code Here

      session = cnn.createQueueSession( false, QueueSession.AUTO_ACKNOWLEDGE );
      ObjectMessage message = session.createObjectMessage();
      message.setObject( data );
      message.setStringProperty( INDEX_NAME_JMS_PROPERTY, indexName );

      sender = session.createSender( processor.getJmsQueue() );
      sender.send( message );

      session.close();
    }
    catch (JMSException e) {
View Full Code Here

      session = cnn.createQueueSession( false, QueueSession.AUTO_ACKNOWLEDGE );
      ObjectMessage message = session.createObjectMessage();
      message.setObject( data );
      message.setStringProperty( INDEX_NAME_JMS_PROPERTY, indexName );

      sender = session.createSender( processor.getJmsQueue() );
      sender.send( message );

      session.close();
    }
    catch (JMSException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.