@Override public void setPriority(int defaultPriority) throws JMSException { delegate.setPriority(defaultPriority); }
message.setStringProperty("LogType", "Task"); producer = queueSession.createProducer(queue); producer.setPriority(priority); producer.send(message); } catch (Exception e) {
message.setStringProperty("LogType", "Process"); producer = queueSession.createProducer(queue); producer.setPriority(priority); producer.send(message); } catch (Exception e) {
@Override public JMSProducer setPriority(int priority) { try { producer.setPriority(priority); } catch (JMSException e) { JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage()); e2.initCause(e); throw e2; } return this; }
producer.setPriority(msg.getPriority()); long ttl = 0; if (msg.getExpiration() != 0) {
@Test public void testBeforeTaskReleasedEvent() throws JMSException { logProducer.beforeTaskReleasedEvent(event); ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class); verify(session).createTextMessage(argument.capture()); String messageContent = argument.getValue(); assertThat(messageContent) .isNotNull() .doesNotContain("<auditTask>") .contains("<org.jbpm.services.task.audit.impl.model.TaskEventImpl>") .contains("<type>RELEASED</type>"); verify(message, times(1)).setStringProperty(eq("LogType"), eq("Task")); verify(producer, times(1)).setPriority(eq(7)); verify(producer, times(1)).send(eq(message)); }
private void assertMessage(String eventStatus, int messagePriority) throws JMSException { ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class); verify(session).createTextMessage(argument.capture()); String messageContent = argument.getValue(); assertThat(messageContent) .isNotNull() .contains("<auditTask>") .contains("<name>This is my task name</name>"); if (eventStatus != null) { assertThat(messageContent) .contains("<org.jbpm.services.task.audit.impl.model.TaskEventImpl>") .contains(eventStatus); } else { assertThat(messageContent).doesNotContain("<org.jbpm.services.task.audit.impl.model.TaskEventImpl>"); } verify(message, times(1)).setStringProperty(eq("LogType"), eq("Task")); verify(producer, times(1)).setPriority(eq(messagePriority)); verify(producer, times(1)).send(eq(message)); } }
@Test public void testAfterTaskInputVariableChanged() throws JMSException { Map<String, Object> vars = new HashMap<>(); vars.put("test", "value"); logProducer.afterTaskInputVariableChangedEvent(event, vars); ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class); verify(session).createTextMessage(argument.capture()); String messageContent = argument.getValue(); assertThat(messageContent) .isNotNull() .doesNotContain("<auditTask>") .doesNotContain("<org.jbpm.services.task.audit.impl.model.TaskEventImpl>") .contains("<taskInputs>"); verify(message, times(1)).setStringProperty(eq("LogType"), eq("Task")); verify(producer, times(1)).setPriority(eq(2)); verify(producer, times(1)).send(eq(message)); }
Mockito.verify(producer).setPriority(5);
/** Delegates the call to the wrapped producer. */ public void setPriority(int priority) throws JMSException { checkValidity(); producer.setPriority(priority); }
/** * Sets the default priority of request messages * * @throws JMSException */ public void setPriority(int priority) throws JMSException { getMessageProducer().setPriority(priority); }
/** Delegates the call to the wrapped producer. */ public void setPriority(int priority) throws JMSException { checkValidity(); producer.setPriority(priority); }
/** * Set the priority * * @param defaultPriority The value * @throws JMSException Thrown if an error occurs */ @Override public void setPriority(final int defaultPriority) throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("setPriority(" + defaultPriority + ")"); } producer.setPriority(defaultPriority); }
@Override public JMSProducer setPriority(int priority) { try { producer.setPriority(priority); } catch (JMSException e) { JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage()); e2.initCause(e); throw e2; } return this; }
@Override public JMSProducer setPriority(int priority) { try { producer.setPriority(priority); } catch (JMSException e) { JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage()); e2.initCause(e); throw e2; } return this; }
@Override public JMSProducer setPriority(int priority) { try { producer.setPriority(priority); } catch (JMSException e) { JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage()); e2.initCause(e); throw e2; } return this; }
@Override public JMSProducer setPriority(int priority) { try { producer.setPriority(priority); } catch (JMSException e) { JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage()); e2.initCause(e); throw e2; } return this; }
@Override public JMSProducer setPriority(final int priority) { try { producer.setPriority(priority); } catch (final JMSException e) { final JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage()); e2.initCause(e); throw e2; } return this; }
private void sendMessage(Queue queue, Session session) throws Exception { MessageProducer mp = session.createProducer(queue); try { mp.setDisableMessageID(true); mp.setDeliveryMode(DeliveryMode.NON_PERSISTENT); mp.setPriority(Message.DEFAULT_PRIORITY); mp.setTimeToLive(Message.DEFAULT_TIME_TO_LIVE); mp.send(session.createTextMessage("This is message for " + queue.getQueueName())); } finally { mp.close(); } } }
public static MessageProducer createMessageProducer( Session session, Destination destination, MessageProducerOption producerOption) throws JMSException { MessageProducer producer = session.createProducer(destination); producer.setDeliveryDelay(producerOption.getDeliveryDelay()); producer.setDeliveryMode(producerOption.getDeliveryMode()); producer.setDisableMessageTimestamp(producerOption.isDisableMessageTimestamp()); producer.setDisableMessageID(producerOption.isDisableMessageId()); producer.setPriority(producerOption.getPriority()); producer.setTimeToLive(producerOption.getTimeToLive()); return producer; }