Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw new Error(
"Length of 'messageId' property on the message cannot be greater than 128 characters."
);
}
amqpMsg.message_id = msg.messageId;
}
if (msg.correlationId != null) {
amqpMsg.correlation_id = msg.correlationId;
}
if (msg.replyToSessionId != null) {
amqpMsg.reply_to_group_id = msg.replyToSessionId;
}
if (msg.timeToLive != null && msg.timeToLive !== Constants.maxDurationValue) {
amqpMsg.ttl = msg.timeToLive;
amqpMsg.creation_time = Date.now();
if (Constants.maxAbsoluteExpiryTime - amqpMsg.creation_time > amqpMsg.ttl) {
amqpMsg.absolute_expiry_time = amqpMsg.creation_time + amqpMsg.ttl;
} else {
amqpMsg.absolute_expiry_time = Constants.maxAbsoluteExpiryTime;
}
}
if (msg.partitionKey != null) {
if (msg.partitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(
"Length of 'partitionKey' property on the message cannot be greater than 128 characters."
);
}
amqpMsg.message_annotations![Constants.partitionKey] = msg.partitionKey;
}
if (msg.viaPartitionKey != null) {
if (msg.viaPartitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(throw new Error(
"Length of 'messageId' property on the message cannot be greater than 128 characters."
);
}
amqpMsg.message_id = msg.messageId;
}
if (msg.correlationId != null) {
amqpMsg.correlation_id = msg.correlationId;
}
if (msg.replyToSessionId != null) {
amqpMsg.reply_to_group_id = msg.replyToSessionId;
}
if (msg.timeToLive != null && msg.timeToLive !== Constants.maxDurationValue) {
amqpMsg.ttl = msg.timeToLive;
amqpMsg.creation_time = Date.now();
if (Constants.maxAbsoluteExpiryTime - amqpMsg.creation_time > amqpMsg.ttl) {
amqpMsg.absolute_expiry_time = amqpMsg.creation_time + amqpMsg.ttl;
} else {
amqpMsg.absolute_expiry_time = Constants.maxAbsoluteExpiryTime;
}
}
if (msg.partitionKey != null) {
if (msg.partitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(
"Length of 'partitionKey' property on the message cannot be greater than 128 characters."
);
}
amqpMsg.message_annotations![Constants.partitionKey] = msg.partitionKey;
}
if (msg.viaPartitionKey != null) {
if (msg.viaPartitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(}
amqpMsg.message_id = msg.messageId;
}
if (msg.correlationId != null) {
amqpMsg.correlation_id = msg.correlationId;
}
if (msg.replyToSessionId != null) {
amqpMsg.reply_to_group_id = msg.replyToSessionId;
}
if (msg.timeToLive != null && msg.timeToLive !== Constants.maxDurationValue) {
amqpMsg.ttl = msg.timeToLive;
amqpMsg.creation_time = Date.now();
if (Constants.maxAbsoluteExpiryTime - amqpMsg.creation_time > amqpMsg.ttl) {
amqpMsg.absolute_expiry_time = amqpMsg.creation_time + amqpMsg.ttl;
} else {
amqpMsg.absolute_expiry_time = Constants.maxAbsoluteExpiryTime;
}
}
if (msg.partitionKey != null) {
if (msg.partitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(
"Length of 'partitionKey' property on the message cannot be greater than 128 characters."
);
}
amqpMsg.message_annotations![Constants.partitionKey] = msg.partitionKey;
}
if (msg.viaPartitionKey != null) {
if (msg.viaPartitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(
"Length of 'viaPartitionKey' property on the message cannot be greater than 128 characters."
);
}}
amqpMsg.message_id = msg.messageId;
}
if (msg.correlationId != null) {
amqpMsg.correlation_id = msg.correlationId;
}
if (msg.replyToSessionId != null) {
amqpMsg.reply_to_group_id = msg.replyToSessionId;
}
if (msg.timeToLive != null && msg.timeToLive !== Constants.maxDurationValue) {
amqpMsg.ttl = msg.timeToLive;
amqpMsg.creation_time = Date.now();
if (Constants.maxAbsoluteExpiryTime - amqpMsg.creation_time > amqpMsg.ttl) {
amqpMsg.absolute_expiry_time = amqpMsg.creation_time + amqpMsg.ttl;
} else {
amqpMsg.absolute_expiry_time = Constants.maxAbsoluteExpiryTime;
}
}
if (msg.partitionKey != null) {
if (msg.partitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(
"Length of 'partitionKey' property on the message cannot be greater than 128 characters."
);
}
amqpMsg.message_annotations![Constants.partitionKey] = msg.partitionKey;
}
if (msg.viaPartitionKey != null) {
if (msg.viaPartitionKey.length > Constants.maxPartitionKeyLength) {
throw new Error(
"Length of 'viaPartitionKey' property on the message cannot be greater than 128 characters."
);
}