本文整理了Java中org.apache.activemq.artemis.api.core.Message.putStringProperty()
方法的一些代码示例,展示了Message.putStringProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.putStringProperty()
方法的具体详情如下:
包路径:org.apache.activemq.artemis.api.core.Message
类名称:Message
方法名:putStringProperty
[英]Puts a String property in this message.
[中]在此消息中放置字符串属性。
代码示例来源:origin: wildfly/wildfly
public static void setJMSReplyTo(Message message, final SimpleString dest) {
if (dest == null) {
message.removeProperty(REPLYTO_HEADER_NAME);
} else {
message.putStringProperty(REPLYTO_HEADER_NAME, dest);
}
}
代码示例来源:origin: wildfly/wildfly
public static void setJMSReplyTo(Message message, final String dest) {
if (dest == null) {
message.removeProperty(REPLYTO_HEADER_NAME);
} else {
message.putStringProperty(REPLYTO_HEADER_NAME, dest);
}
}
代码示例来源:origin: wildfly/wildfly
public static void setJMSType(Message message, String type) {
message.putStringProperty(TYPE_HEADER_NAME, new SimpleString(type));
}
代码示例来源:origin: wildfly/wildfly
public static void setJMSCorrelationID(Message message, final String correlationID) {
if (correlationID == null) {
message.removeProperty(CORRELATIONID_HEADER_NAME);
} else {
message.putStringProperty(CORRELATIONID_HEADER_NAME, new SimpleString(correlationID));
}
}
代码示例来源:origin: org.apache.activemq/artemis-core-client
public static void setJMSReplyTo(Message message, final String dest) {
if (dest == null) {
message.removeProperty(REPLYTO_HEADER_NAME);
} else {
message.putStringProperty(REPLYTO_HEADER_NAME, dest);
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setJMSReplyTo(Message message, final SimpleString dest) {
if (dest == null) {
message.removeProperty(REPLYTO_HEADER_NAME);
} else {
message.putStringProperty(REPLYTO_HEADER_NAME, dest);
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setJMSReplyTo(Message message, final SimpleString dest) {
if (dest == null) {
message.removeProperty(REPLYTO_HEADER_NAME);
} else {
message.putStringProperty(REPLYTO_HEADER_NAME, dest);
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setJMSReplyTo(Message message, final String dest) {
if (dest == null) {
message.removeProperty(REPLYTO_HEADER_NAME);
} else {
message.putStringProperty(REPLYTO_HEADER_NAME, dest);
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setJMSCorrelationID(Message message, final String correlationID) {
if (correlationID == null) {
message.removeProperty(CORRELATIONID_HEADER_NAME);
} else {
message.putStringProperty(CORRELATIONID_HEADER_NAME, new SimpleString(correlationID));
}
}
代码示例来源:origin: org.apache.activemq/artemis-jms-client-all
public static void setJMSCorrelationID(Message message, final String correlationID) {
if (correlationID == null) {
message.removeProperty(CORRELATIONID_HEADER_NAME);
} else {
message.putStringProperty(CORRELATIONID_HEADER_NAME, new SimpleString(correlationID));
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setJMSCorrelationID(Message message, final String correlationID) {
if (correlationID == null) {
message.removeProperty(CORRELATIONID_HEADER_NAME);
} else {
message.putStringProperty(CORRELATIONID_HEADER_NAME, new SimpleString(correlationID));
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setStringProperty(final Message message, final String name, final String value) {
if (MessageUtil.JMSXGROUPID.equals(name)) {
message.setGroupID(value);
} else if (MessageUtil.JMSXGROUPSEQ.equals(name)) {
message.setGroupSequence(getInteger(value));
} else if (MessageUtil.JMSXUSERID.equals(name)) {
message.setValidatedUserID(value);
} else {
message.putStringProperty(name, value);
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setStringProperty(final Message message, final String name, final String value) {
if (MessageUtil.JMSXGROUPID.equals(name)) {
message.setGroupID(value);
} else if (MessageUtil.JMSXGROUPSEQ.equals(name)) {
message.setGroupSequence(getInteger(value));
} else if (MessageUtil.JMSXUSERID.equals(name)) {
message.setValidatedUserID(value);
} else {
message.putStringProperty(name, value);
}
}
代码示例来源:origin: apache/activemq-artemis
public static void setStringProperty(final Message message, final String name, final String value) {
if (MessageUtil.JMSXGROUPID.equals(name)) {
message.setGroupID(value);
} else if (MessageUtil.JMSXGROUPSEQ.equals(name)) {
message.setGroupSequence(getInteger(value));
} else if (MessageUtil.JMSXUSERID.equals(name)) {
message.setValidatedUserID(value);
} else {
message.putStringProperty(name, value);
}
}
代码示例来源:origin: apache/activemq-artemis
private Message createQueueInfoMessage(final NotificationType type, final SimpleString queueName) {
Message message = new CoreMessage().initBuffer(50).setMessageID(storageManager.generateID());
message.setAddress(queueName);
String uid = UUIDGenerator.getInstance().generateStringUUID();
message.putStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE, new SimpleString(type.toString()));
message.putLongProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP, System.currentTimeMillis());
message.putStringProperty(new SimpleString("foobar"), new SimpleString(uid));
return message;
}
代码示例来源:origin: apache/activemq-artemis
@Override
public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException {
if (packet.getType() == PacketImpl.SESS_SEND) {
SessionSendMessage p = (SessionSendMessage) packet;
Message sm = p.getMessage();
sm.putStringProperty(InterceptorTest.key, "orange");
}
return true;
}
代码示例来源:origin: apache/activemq-artemis
@Override
public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException {
if (packet.getType() == PacketImpl.SESS_RECEIVE_MSG) {
SessionReceiveMessage p = (SessionReceiveMessage) packet;
Message sm = p.getMessage();
sm.putStringProperty(InterceptorTest.key, "orange");
}
return true;
}
代码示例来源:origin: apache/activemq-artemis
@Test
public void testNewlineMatch() throws Exception {
filter = FilterImpl.createFilter(new SimpleString("fooprop LIKE '%1234%'"));
message.putStringProperty(new SimpleString("fooprop"), new SimpleString("hello1234\n"));
Assert.assertTrue(filter.match(message));
}
代码示例来源:origin: apache/activemq-artemis
@Test
public void testNOT_LIKEWithNullProperty() throws Exception {
filter = FilterImpl.createFilter(new SimpleString("myNullProp NOT LIKE '1_3'"));
assertFalse(filter.match(message));
message.putStringProperty("myNullProp", "JMS");
assertTrue(filter.match(message));
}
代码示例来源:origin: apache/activemq-artemis
@Test
public void testNOT_INWithNullProperty() throws Exception {
filter = FilterImpl.createFilter(new SimpleString("myNullProp NOT IN ('foo','jms','test')"));
assertFalse(filter.match(message));
message.putStringProperty("myNullProp", "JMS");
assertTrue(filter.match(message));
}
内容来源于网络,如有侵权,请联系作者删除!