Example usage for javax.jms Message getStringProperty

List of usage examples for javax.jms Message getStringProperty

Introduction

In this page you can find the example usage for javax.jms Message getStringProperty.

Prototype


String getStringProperty(String name) throws JMSException;

Source Link

Document

Returns the value of the String property with the specified name.

Usage

From source file:org.calrissian.mango.jms.stream.utils.SendReceiveRequestor.java

public static String getReplyToId(Message msg) throws JMSException {
    return msg.getStringProperty(REPLYTO_ID);
}

From source file:de.slub.fedora.jms.MessageMapper.java

public static List<IndexJob> map(Message message) throws Exception {
    ArrayList<IndexJob> indexJobs = new ArrayList<>();
    String pid = message.getStringProperty("pid");
    String dsid = extractDsId(((TextMessage) message).getText());
    String methodName = message.getStringProperty("methodName");
    switch (methodName) {
    case "ingest":
        indexJobs.add(new ObjectIndexJob(CREATE, pid, 1, TimeUnit.SECONDS));
        break;// w  w w.  j  a  va 2 s.c  o  m
    case "addDatastream":
        indexJobs.add(new DatastreamIndexJob(CREATE, pid, dsid, 1, TimeUnit.SECONDS));
        break;
    case "purgeObject":
        indexJobs.add(new ObjectIndexJob(DELETE, pid));
        break;
    case "purgeDatastream":
        indexJobs.add(new DatastreamIndexJob(DELETE, pid, dsid));
        break;
    case "modifyObject":
        indexJobs.add(new ObjectIndexJob(UPDATE, pid, 5, TimeUnit.SECONDS));
        break;
    case "modifyDatastreamByReference":
    case "modifyDatastreamByValue":
    case "setDatastreamState":
        indexJobs.add(new ObjectIndexJob(UPDATE, pid, dsid, 1, TimeUnit.SECONDS));
        indexJobs.add(new DatastreamIndexJob(UPDATE, pid, dsid, 5, TimeUnit.SECONDS));
        break;
    }
    return indexJobs;
}

From source file:org.fcrepo.integration.jms.observer.HeadersJMSIT.java

private static String getBaseURL(final Message msg) throws JMSException {
    return msg.getStringProperty(BASE_URL_HEADER_NAME);
}

From source file:org.fcrepo.integration.jms.observer.HeadersJMSIT.java

private static String getProperties(final Message msg) throws JMSException {
    return msg.getStringProperty(PROPERTIES_HEADER_NAME);
}

From source file:org.fcrepo.integration.jms.observer.HeadersJMSIT.java

private static String getPath(final Message msg) throws JMSException {
    final String id = msg.getStringProperty(IDENTIFIER_HEADER_NAME);
    LOGGER.debug("Processing an event with identifier: {}", id);
    return id;/* w w w . ja va2s  . c om*/
}

From source file:org.fcrepo.integration.jms.observer.HeadersJMSIT.java

private static String getEventTypes(final Message msg) throws JMSException {
    final String type = msg.getStringProperty(EVENT_TYPE_HEADER_NAME);
    LOGGER.debug("Processing an event with type: {}", type);
    return type;//from   ww  w .  j a  va 2  s .c  om
}

From source file:com.adaptris.core.jms.MessageTypeTranslatorCase.java

public static void assertJmsProperties(Message jmsMsg) throws JMSException {
    assertEquals(STRING_VALUE, jmsMsg.getStringProperty(STRING_METADATA));
    assertEquals(BOOLEAN_VALUE, jmsMsg.getStringProperty(BOOLEAN_METADATA));
    assertEquals(Boolean.valueOf(BOOLEAN_VALUE).booleanValue(), jmsMsg.getBooleanProperty(BOOLEAN_METADATA)); // default
    assertEquals(INTEGER_VALUE, jmsMsg.getStringProperty(INTEGER_METADATA));
    assertEquals(Integer.valueOf(INTEGER_VALUE).intValue(), jmsMsg.getIntProperty(INTEGER_METADATA));
}

From source file:com.amalto.core.server.routing.DefaultRoutingEngine.java

private static String[] getRulesList(Message message) throws JMSException {
    return StringUtils.split(message.getStringProperty(JMS_RULES_PROPERTY), JMS_RULES_PROPERTY_SEPARATOR);
}

From source file:com.jim.im.message.config.ImMessageListener.java

@Override
public void onMessage(Message message) {
    try {//from  w  w  w.  j ava 2s  .c  om
        String isFromPusher = message.getStringProperty(IMConstant.IS_FROM_PUSHER);
        if (!StringUtil.equals(isFromPusher, Boolean.TRUE.toString())) {
            ImMessage imMessage = (ImMessage) messageConverter.fromMessage(message);
            messageService.pushMessage(imMessage);
        }
    } catch (JMSException e) {
        LOGGER.error("From ActiveMQ message delivery failure.", e);
    } catch (ImException e) {
        LOGGER.error("From ActiveMQ message delivery failure.", e);
    }
}

From source file:com.jim.im.broker.config.ImBrokerMessageListener.java

@Override
public void onMessage(Message message) {
    try {/*from w ww  .j  ava  2  s.  c  om*/
        String brokerName = message.getStringProperty(IMConstant.BROKER_NAME);
        if (!StringUtil.equals(brokerName, mqttServer.getBrokerName())) {
            ImMessage imMessage = (ImMessage) messageConverter.fromMessage(message);
            final PublishMessage publishMessage = createPublishMessage(imMessage);
            executorService.execute(new Runnable() {
                @Override
                public void run() {
                    mqttServer.internalPublish(publishMessage);
                }
            });
        }
    } catch (JMSException e) {
        LOGGER.error("From ActiveMQ message delivery failure.", e);
    } catch (UnsupportedEncodingException e) {
        LOGGER.error("From ActiveMQ message that encoding failure.", e);
    }
}