Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when set message HeaderTable, the ReplyTo property Settings have been cleared. #315

Open
liusong1217 opened this issue Feb 24, 2023 · 3 comments

Comments

@liusong1217
Copy link

“ret._flags = AMQP_BASIC_HEADERS_FLAG(1<<13) “ might need to be put before AMQP_BASIC_DELIVERY_MODE_FLAG(1<<12)

@liusong1217
Copy link
Author

In Channel.cpp amqp_basic_properties_t CreateAmqpProperties(const BasicMessage &mes, Detail::amqp_pool_ptr_t &pool).

@liusong1217
Copy link
Author

amqp_basic_properties_t CreateAmqpProperties(const BasicMessage &mes,
Detail::amqp_pool_ptr_t &pool) {
amqp_basic_properties_t ret;
ret._flags = 0;

if (mes.ContentTypeIsSet()) {
ret.content_type = StringToBytes(mes.ContentType());
ret._flags |= AMQP_BASIC_CONTENT_TYPE_FLAG;
}
if (mes.ContentEncodingIsSet()) {
ret.content_encoding = StringToBytes(mes.ContentEncoding());
ret._flags |= AMQP_BASIC_CONTENT_ENCODING_FLAG;
}
if (mes.HeaderTableIsSet()) {
ret.headers =
Detail::TableValueImpl::CreateAmqpTable(mes.HeaderTable(), pool);
ret._flags = AMQP_BASIC_HEADERS_FLAG;
}
if (mes.DeliveryModeIsSet()) {
// TODO: something more advanced?
ret.delivery_mode = mes.DeliveryMode();
ret._flags |= AMQP_BASIC_DELIVERY_MODE_FLAG;
}
if (mes.PriorityIsSet()) {
ret.priority = mes.Priority();
ret._flags |= AMQP_BASIC_PRIORITY_FLAG;
}
if (mes.CorrelationIdIsSet()) {
ret.correlation_id = StringToBytes(mes.CorrelationId());
ret._flags |= AMQP_BASIC_CORRELATION_ID_FLAG;
}
if (mes.ReplyToIsSet()) {
ret.reply_to = StringToBytes(mes.ReplyTo());
ret._flags |= AMQP_BASIC_REPLY_TO_FLAG;
}
if (mes.ExpirationIsSet()) {
ret.expiration = StringToBytes(mes.Expiration());
ret._flags = AMQP_BASIC_EXPIRATION_FLAG;
}
if (mes.MessageIdIsSet()) {
ret.message_id = StringToBytes(mes.MessageId());
ret._flags = AMQP_BASIC_MESSAGE_ID_FLAG;
}
if (mes.TimestampIsSet()) {
ret.timestamp = mes.Timestamp();
ret._flags = AMQP_BASIC_TIMESTAMP_FLAG;
}
if (mes.TypeIsSet()) {
ret.type = StringToBytes(mes.Type());
ret._flags = AMQP_BASIC_TYPE_FLAG;
}
if (mes.UserIdIsSet()) {
ret.user_id = StringToBytes(mes.UserId());
ret._flags = AMQP_BASIC_USER_ID_FLAG;
}
if (mes.AppIdIsSet()) {
ret.app_id = StringToBytes(mes.AppId());
ret._flags = AMQP_BASIC_APP_ID_FLAG;
}
if (mes.ClusterIdIsSet()) {
ret.cluster_id = StringToBytes(mes.ClusterId());
ret._flags = AMQP_BASIC_CLUSTER_ID_FLAG;
}
return ret;
}

@liusong1217
Copy link
Author

The above is modified, please see if there is anything wrong.Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant