-
Notifications
You must be signed in to change notification settings - Fork 372
Global configuration for deletion policy #621
Global configuration for deletion policy #621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MatejNedic for another contribution! I am not sure if this change lasts till 3.0 as I hope for solid SQS integration redesign, but I think it can go with 2.3.
* If this is set in SqsListener, it will use global value set for specific QueueMessageHandlerFactory. | ||
* Default, if not changed is set to NO_REDRIVE. | ||
*/ | ||
GLOBAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think DEFAULT
would be a better name. global
-> default
should be applied then in every other changed file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True default is better. Done
@@ -73,6 +74,7 @@ | |||
static final String LOGICAL_RESOURCE_ID = "LogicalResourceId"; | |||
static final String ACKNOWLEDGMENT = "Acknowledgment"; | |||
static final String VISIBILITY = "Visibility"; | |||
private SqsMessageDeletionPolicy globalSqsMessageDeletionPolicy = SqsMessageDeletionPolicy.NO_REDRIVE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this field as final and pass value in constructor? Regarding name defaultMessageDeletionPolicy
would fit better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do some minor polishing but other than that looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MatejNedic for another great contribution. I have left just small comments.
@@ -73,15 +74,18 @@ | |||
static final String LOGICAL_RESOURCE_ID = "LogicalResourceId"; | |||
static final String ACKNOWLEDGMENT = "Acknowledgment"; | |||
static final String VISIBILITY = "Visibility"; | |||
private final SqsMessageDeletionPolicy defaultSqsMessageDeletionPolicy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra space. Also, can be renamed to sqsMessageDeletionPolicy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -119,6 +121,9 @@ void messageHandler_withFactoryConfiguration_shouldUseCustomValues() | |||
assertThat(messageHandler.getCustomReturnValueHandlers().get(0)).isEqualTo( | |||
ConfigurationWithCustomizedMessageHandler.CUSTOM_RETURN_VALUE_HANDLER); | |||
|
|||
Object sqsMessageDeletionPolicy = ReflectionTestUtils.getField(messageHandler,"defaultSqsMessageDeletionPolicy"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be a space before "defaultSqsMessageDeletionPolicy"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ConfigurationWithCustomizedMessageHandlerGlobalDeletionPolicy.CUSTOM_RETURN_VALUE_HANDLER); | ||
|
||
|
||
Object sqsMessageDeletionPolicy = ReflectionTestUtils.getField(messageHandler,"defaultSqsMessageDeletionPolicy"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be a space before "defaultSqsMessageDeletionPolicy"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -52,6 +54,8 @@ | |||
|
|||
private ResourceIdResolver resourceIdResolver; | |||
|
|||
private SqsMessageDeletionPolicy defaultSqsMessageDeletionPolicy = SqsMessageDeletionPolicy.NO_REDRIVE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just sqsMessageDeletionPolicy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks! I am merging it, don't worry about conflicts. |
AWS SQS: Add global configuration for deletionPolicy #188