in python/rocketmq/v5/producer/producer.py [0:0]
def __send_message_type(self, message: Message, is_transaction=False):
if (
message.message_group is None
and message.delivery_timestamp is None
and is_transaction is False
):
return MessageType.NORMAL
if message.message_group is not None and is_transaction is False:
return MessageType.FIFO
if message.delivery_timestamp is not None and is_transaction is False:
return MessageType.DELAY
if (
message.message_group is None
and message.delivery_timestamp is None
and is_transaction is True
):
return MessageType.TRANSACTION
# transaction semantics is conflicted with fifo/delay.
logger.error(
f"{self.__str__()} set send message type exception, message: {str(message)}"
)
raise IllegalArgumentException(
"transactional message should not set messageGroup or deliveryTimestamp"
)