@Override public Object evaluate(Message message) { Object userId = message.getUserID(); if (userId == null) { try { userId = message.getProperty("JMSXUserID"); } catch (IOException e) { } } return userId; } });
private boolean stampAsExpired(Message message) throws IOException { boolean stamped = false; if (message.getProperty(ORIGINAL_EXPIRATION) == null) { long expiration = message.getExpiration(); message.setProperty(ORIGINAL_EXPIRATION, new Long(expiration)); stamped = true; } return stamped; }
public Object evaluate(Message message) throws JMSException { if (jmsPropertyExpression != null) { return jmsPropertyExpression.evaluate(message); } try { return message.getProperty(name); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
if (propertyName != null && reference.getMessage().getProperty(propertyName) != null) { Object key = reference.getMessage().getProperty(propertyName); if (pivots.containsKey(key)) { MessageReference pivot = pivots.get(key);
@Override public Object evaluate(MessageEvaluationContext message) throws JMSException { try { if (message.isDropped()) { return null; } if (jmsPropertyExpression != null) { return jmsPropertyExpression.evaluate(message.getMessage()); } try { return message.getMessage().getProperty(name); } catch (IOException ioe) { throw JMSExceptionSupport.create("Could not get property: " + name + " reason: " + ioe.getMessage(), ioe); } } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
private boolean redeliveryExceeded(MessageDispatch md) { try { return session.getTransacted() && redeliveryPolicy != null && redeliveryPolicy.isPreDispatchCheck() && redeliveryPolicy.getMaximumRedeliveries() != RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES && md.getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries() // redeliveryCounter > x expected after resend via brokerRedeliveryPlugin && md.getMessage().getProperty("redeliveryDelay") == null; } catch (Exception ignored) { return false; } }
ConnectionContext context = producerExchange.getConnectionContext(); final String jobId = (String) messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_ID); final Object cronValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_CRON); final Object periodValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_PERIOD); final Object delayValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY); ActiveMQDestination replyTo = messageSend.getReplyTo(); String action = (String) messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION); Object startTime = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION_START_TIME); Object endTime = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION_END_TIME);
public boolean add(ConnectionContext context, MessageReference node) throws Exception { final Message message = node.getMessage(); final Object retainValue = message.getProperty(RETAIN_PROPERTY); // retain property set to true final boolean retain = retainValue != null && Boolean.parseBoolean(retainValue.toString()); if (retain) { if (message.getContent().getLength() > 0) { // non zero length message content retainedMessage = message.copy(); retainedMessage.getMessage().removeProperty(RETAIN_PROPERTY); retainedMessage.getMessage().setProperty(RETAINED_PROPERTY, true); } else { // clear retained message retainedMessage = null; } // TODO should we remove the publisher's retain property?? node.getMessage().removeProperty(RETAIN_PROPERTY); } return wrapped == null ? true : wrapped.add(context, node); }
public void preProcessDispatch(MessageDispatch messageDispatch) { try { if (messageDispatch != null && messageDispatch.getMessage() != null) { String brokerStamp = (String)messageDispatch.getMessage().getProperty(getStampProperty()); if (brokerStamp == null) { brokerStamp = getBrokerName(); } else { brokerStamp += "," + getBrokerName(); } messageDispatch.getMessage().setProperty(getStampProperty(), brokerStamp); messageDispatch.getMessage().setMarshalledProperties(null); } } catch (IOException ioe) { LOG.warn("Setting broker property failed", ioe); } super.preProcessDispatch(messageDispatch); } }
Message messageSend = (Message) wireFormat.unmarshal(packet); messageSend.setOriginalTransactionId(null); Object repeatValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_REPEAT); Object cronValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_CRON); String cronStr = cronValue != null ? cronValue.toString() : null; int repeat = 0;
private void doSchedule(Message messageSend, Object cronValue, Object periodValue, Object delayValue) throws Exception { long delay = 0; long period = 0; int repeat = 0; String cronEntry = ""; // clear transaction context Message msg = messageSend.copy(); msg.setTransactionId(null); org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(msg); if (cronValue != null) { cronEntry = cronValue.toString(); } if (periodValue != null) { period = (Long) TypeConversionSupport.convert(periodValue, Long.class); } if (delayValue != null) { delay = (Long) TypeConversionSupport.convert(delayValue, Long.class); } Object repeatValue = msg.getProperty(ScheduledMessage.AMQ_SCHEDULED_REPEAT); if (repeatValue != null) { repeat = (Integer) TypeConversionSupport.convert(repeatValue, Integer.class); } //job id should be unique for every job (Same format as MessageId) MessageId jobId = new MessageId(messageSend.getMessageId().getProducerId(), longGenerator.getNextSequenceId()); getInternalScheduler().schedule(jobId.toString(), new ByteSequence(packet.data, packet.offset, packet.length), cronEntry, delay, period, repeat); }
@Override public Object evaluate(Message message) { Object userId = message.getUserID(); if (userId == null) { try { userId = message.getProperty("JMSXUserID"); } catch (IOException e) { } } return userId; } });
@Override public Object evaluate(Message message) { Object userId = message.getUserID(); if (userId == null) { try { userId = message.getProperty("JMSXUserID"); } catch (IOException e) { } } return userId; } });
@Override public Object evaluate(Message message) { Object userId = message.getUserID(); if (userId == null) { try { userId = message.getProperty("JMSXUserID"); } catch (IOException e) { } } return userId; } });
private boolean stampAsExpired(Message message) throws IOException { boolean stamped = false; if (message.getProperty(ORIGINAL_EXPIRATION) == null) { long expiration = message.getExpiration(); message.setProperty(ORIGINAL_EXPIRATION, new Long(expiration)); stamped = true; } return stamped; }
private boolean stampAsExpired(Message message) throws IOException { boolean stamped = false; if (message.getProperty(ORIGINAL_EXPIRATION) == null) { long expiration = message.getExpiration(); message.setProperty(ORIGINAL_EXPIRATION, new Long(expiration)); stamped = true; } return stamped; }
private boolean stampAsExpired(Message message) throws IOException { boolean stamped = false; if (message.getProperty(ORIGINAL_EXPIRATION) == null) { long expiration = message.getExpiration(); message.setProperty(ORIGINAL_EXPIRATION, new Long(expiration)); stamped = true; } return stamped; }
public Object evaluate(Message message) throws JMSException { if (jmsPropertyExpression != null) { return jmsPropertyExpression.evaluate(message); } try { return message.getProperty(name); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
public Object evaluate(Message message) throws JMSException { if (jmsPropertyExpression != null) { return jmsPropertyExpression.evaluate(message); } try { return message.getProperty(name); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
private boolean redeliveryExceeded(MessageDispatch md) { try { return session.getTransacted() && redeliveryPolicy != null && redeliveryPolicy.isPreDispatchCheck() && redeliveryPolicy.getMaximumRedeliveries() != RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES && md.getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries() // redeliveryCounter > x expected after resend via brokerRedeliveryPlugin && md.getMessage().getProperty("redeliveryDelay") == null; } catch (Exception ignored) { return false; } }