@Override public ObjectMessage createObjectMessage() throws JMSException { return next.createObjectMessage(); }
@Override public ObjectMessage createObjectMessage(Serializable object) throws JMSException { return next.createObjectMessage(object); }
/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
/** * @param object * @return * @throws JMSException */ public ObjectMessage createObjectMessage(Serializable object) throws JMSException { return next.createObjectMessage(object); }
@Override public ObjectMessage createObjectMessage(Serializable object) throws JMSException { return next.createObjectMessage(object); }
/** * @return * @throws JMSException */ public ObjectMessage createObjectMessage() throws JMSException { return next.createObjectMessage(); }
@Override public ObjectMessage createObjectMessage() throws JMSException { return next.createObjectMessage(); }
@Override public ObjectMessage createObjectMessage(Serializable object) throws JMSException { return next.createObjectMessage(object); }
@Override public ObjectMessage createObjectMessage(Serializable object) throws JMSException { return next.createObjectMessage(object); }
@Override public ObjectMessage createObjectMessage() throws JMSException { return next.createObjectMessage(); }
@Override public ObjectMessage createObjectMessage() throws JMSException { return next.createObjectMessage(); }
public void sendEvent(BaseTerminalEvent baseDeskEvent) { try { ObjectMessage textMessage = session.createObjectMessage(baseDeskEvent); sender.send(textMessage); } catch (JMSException ex) { System.out.println("Error sending event:" + ex.toString()); } }
/** * Send a <code>ObjectMessage</code> with an empty body. * <br /> * Receive it and test if the message is effectively an instance of * <code>ObjectMessage</code> */ public void testObjectMessage_1() { try { ObjectMessage message = senderSession.createObjectMessage(); sender.send(message); Message msg = receiver.receive(TestConfig.TIMEOUT); assertTrue("The message should be an instance of ObjectMessage.\n", msg instanceof ObjectMessage); } catch (JMSException e) { fail(e); } }
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);
/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
/** * This method called by {@link AppenderBase#doAppend} method to do most * of the real appending work. */ public void append(ILoggingEvent event) { if (!isStarted()) { return; } try { ObjectMessage msg = queueSession.createObjectMessage(); Serializable so = pst.transform(event); msg.setObject(so); queueSender.send(msg); successiveFailureCount = 0; } catch (Exception e) { successiveFailureCount++; if (successiveFailureCount > SUCCESSIVE_FAILURE_LIMIT) { stop(); } addError("Could not send message in JMSQueueAppender [" + name + "].", e); } }
/** * Send an <code>ObjectMessage</code> with a <code>Vector</code> (composed of a <code> * String</code> and a <code>double</code>) in its body. * <br /> * Receive it and test that the values of the primitives of the body are correct */ @Test public void testObjectMessage_2() { try { Vector<Object> vector = new Vector<>(); vector.add("pi"); vector.add(new Double(3.14159)); ObjectMessage message = senderSession.createObjectMessage(); message.setObject(vector); sender.send(message); Message m = receiver.receive(TestConfig.TIMEOUT); Assert.assertTrue("The message should be an instance of ObjectMessage.\n", m instanceof ObjectMessage); ObjectMessage msg = (ObjectMessage) m; Assert.assertEquals(vector, msg.getObject()); } catch (JMSException e) { fail(e); } }
/** * Send a <code>ObjectMessage</code> with an empty body. * <br /> * Receive it and test if the message is effectively an instance of * <code>ObjectMessage</code> */ @Test public void testObjectMessage_1() { try { ObjectMessage message = senderSession.createObjectMessage(); sender.send(message); Message msg = receiver.receive(TestConfig.TIMEOUT); Assert.assertTrue("The message should be an instance of ObjectMessage.\n", msg instanceof ObjectMessage); } catch (JMSException e) { fail(e); } }
private void sendMessage(List<LuceneWork> queue) throws Exception { ObjectMessage message = getQueueSession().createObjectMessage(); final String indexName = getIndexName(); message.setStringProperty( Environment.INDEX_NAME_JMS_PROPERTY, indexName ); byte[] data = getExtendedSearchIntegrator().getWorkSerializer().toSerializedModel( queue ); message.setObject( data ); QueueSender sender = getQueueSession().createSender( getMessageQueue() ); sender.send( message ); }