private void sendObjectMessages(int nMsgs, ConnectionFactory factory) throws Exception { try (Connection connection = factory.createConnection()) { Session session = connection.createSession(); Queue queue = session.createQueue(testQueueName); MessageProducer producer = session.createProducer(queue); ObjectMessage msg = session.createObjectMessage(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < PAYLOAD; ++i) { builder.append("A"); } msg.setObject(builder.toString()); for (int i = 0; i < nMsgs; ++i) { msg.setIntProperty("i", (Integer) i); producer.send(msg); } } }
objMsg.setIntProperty(JMSEndpoint.ARR_PROPERTY, 1); objMsg.setIntProperty(JMSEndpoint.SVC_PROPERTY, 1); objMsg.setIntProperty(JMSEndpoint.OPN_PROPERTY, 1);
loadRequest.setIntProperty(CACHE_MANAGER_UID, localCacheManagerUid(cache)); getQueueSender.send(loadRequest, DeliveryMode.NON_PERSISTENT, HIGHEST_JMS_PRORITY, timeoutMillis);
loadRequest.setIntProperty(CACHE_MANAGER_UID, localCacheManagerUid(cache)); getQueueSender.send(loadRequest, DeliveryMode.NON_PERSISTENT, HIGHEST_JMS_PRORITY, timeoutMillis);
Queue q = (Queue) ServiceLocator.getInstance().getDestination("QUEUE"); QueueConnectionFactory factory = (QueueConnectionFactory) ServiceLocator.getInstance().getConnectionFactory( "java:/ConnectionFactory"); QueueConnection connection = factory.createQueueConnection(); QueueSession session = null; QueueSender sender = null; session = connection.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE); sender = session.createSender(q); ObjectMessage msg = session.createObjectMessage(); if (redelivedCount > 0) { msg.setIntProperty("redelivedCount", redelivedCount); // schedule to run in 10 secs msg.setLongProperty("_AMQ_SCHED_DELIVERY", System.currentTimeMillis() + 10000); } msg.setStringProperty("action", action); msg.setObject(params); sender.send(msg);
objMsg.setStringProperty(JMSEndpoint.DOM_PROPERTY, ldomain); objMsg.setStringProperty(JMSEndpoint.NET_PROPERTY, lnetwork); objMsg.setIntProperty(JMSEndpoint.ARR_PROPERTY, area); objMsg.setIntProperty(JMSEndpoint.SVC_PROPERTY, service); objMsg.setIntProperty(JMSEndpoint.OPN_PROPERTY, operation); objMsg.setStringProperty(JMSEndpoint.EID_PROPERTY, publishEntry.eKey.getFirstSubKey().getValue()); objMsg.setObjectProperty(JMSEndpoint.DID_PROPERTY, publishEntry.eKey.getSecondSubKey());