[
https://issues.apache.org/jira/browse/ARTEMIS-5251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
gongping.zhu updated ARTEMIS-5251:
----------------------------------
Description:
When I send a retained message in the plugin, the consumer does not receive the
message with the retained flag. Why is this? Below is the code of my plugin.
ByteBuf payloadByteBuf =
Unpooled.wrappedBuffer(payload.getBytes(StandardCharsets.UTF_8));
SimpleStringaddress=SimpleString.of(topic);
CoreMessagemessage=newCoreMessage().initBuffer(payloadByteBuf.readableBytes()).setMessageID(serverRefRef.get().getStorageManager().generateID());
message.putBooleanProperty(MQTTUtil.MQTT_MESSAGE_RETAIN_KEY, true);
message.putIntProperty(MQTTUtil.MQTT_QOS_LEVEL_KEY, qosLevel);
message.putStringProperty(STATUS_FROM, from);
message.setType(Message.BYTES_TYPE);
message.putStringProperty(MessageUtil.CONNECTION_ID_PROPERTY_NAME, clientId);
AddressInfoaddressInfo= serverRefRef.get().getAddressInfo(address);
if (addressInfo !=null) {
message.setRoutingType(addressInfo.getRoutingType());
}
message.setAddress(address);
message.getBodyBuffer().writeBytes(payloadByteBuf, 0,
payloadByteBuf.readableBytes());
session.send(tx,message,true,name,false);
was:When I send a retained message in the plugin, the consumer does not
receive the message with the retained flag. Why is this? Below is the code of
my plugin.
> the consumer does not receive the message with the retained flag
> ----------------------------------------------------------------
>
> Key: ARTEMIS-5251
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5251
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: gongping.zhu
> Priority: Major
>
> When I send a retained message in the plugin, the consumer does not receive
> the message with the retained flag. Why is this? Below is the code of my
> plugin.
>
> ByteBuf payloadByteBuf =
> Unpooled.wrappedBuffer(payload.getBytes(StandardCharsets.UTF_8));
> SimpleStringaddress=SimpleString.of(topic);
> CoreMessagemessage=newCoreMessage().initBuffer(payloadByteBuf.readableBytes()).setMessageID(serverRefRef.get().getStorageManager().generateID());
> message.putBooleanProperty(MQTTUtil.MQTT_MESSAGE_RETAIN_KEY, true);
> message.putIntProperty(MQTTUtil.MQTT_QOS_LEVEL_KEY, qosLevel);
> message.putStringProperty(STATUS_FROM, from);
> message.setType(Message.BYTES_TYPE);
> message.putStringProperty(MessageUtil.CONNECTION_ID_PROPERTY_NAME, clientId);
> AddressInfoaddressInfo= serverRefRef.get().getAddressInfo(address);
> if (addressInfo !=null) {
> message.setRoutingType(addressInfo.getRoutingType());
> }
> message.setAddress(address);
> message.getBodyBuffer().writeBytes(payloadByteBuf, 0,
> payloadByteBuf.readableBytes());
> session.send(tx,message,true,name,false);
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact