Skip to content

Commit

Permalink
fixed sns msg id (#341)
Browse files Browse the repository at this point in the history
* Updated v1 pipeline rules (#309)

* Updated deployment group for E2E env

* V1 branch rules updated (#308)

* Updated deployment group for E2E env (#305)

* updated rules as per v1_* branches

* 1.1.2 fixing SNS publish batch-size issue (#339)

* Updated deployment group for E2E env
* V1 branch rules updated (#308)
* Updated deployment group for E2E env (#305)
* updated rules as per v1_* branches
* Fixed SNS publish batch-size issue
* debug pipeline failure
* include hidden file in artifact

* Fixed SNS publish batch-size issue

* fixed sns publish msg id
  • Loading branch information
hirenkp2000 authored Sep 10, 2024
1 parent dee6652 commit dff4741
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,8 @@ public void publishTransactions(final PubConfig pubCfg, final Subscription sub,
final int msgLength = msg.length();
final Map<String, MessageAttributeValue> msgAttrMap = populateMessageAttributeMap(txnData, sub, spaceId);

// Prepare PublishBatchEntry for current message
final PublishBatchRequestEntry batchEntry = PublishBatchRequestEntry.builder()
.message(msg)
.messageAttributes(msgAttrMap)
.id(MSG_ID_PREFIX + batchEntryCounter)
.build();

// publish batch if payload limit reached
if (msgLength+aggrBatchPayloadSize > MAX_ALLOWED_PAYLOAD_SIZE && batchEntries.size()>0) {
// publish accumulated batch if payload limit reached
if (msgLength+aggrBatchPayloadSize > MAX_ALLOWED_PAYLOAD_SIZE && !batchEntries.isEmpty()) {
// publish current batch
publishBatchEntriesAndCheckResult(batchEntries, snsTopic, snsClient, txnList, subId, publishedRecCnt, MSG_ID_PREFIX, pubCfg, pubDTO);
// update batch variables
Expand All @@ -81,6 +74,12 @@ public void publishTransactions(final PubConfig pubCfg, final Subscription sub,
batchEntryCounter = 0;
}

// Prepare PublishBatchEntry for current message
final PublishBatchRequestEntry batchEntry = PublishBatchRequestEntry.builder()
.message(msg)
.messageAttributes(msgAttrMap)
.id(MSG_ID_PREFIX + batchEntryCounter)
.build();
// add current message to the batch
batchEntries.add(batchEntry);
aggrBatchPayloadSize += msgLength;
Expand Down

0 comments on commit dff4741

Please sign in to comment.