|
83 | 83 | * Message can be released as soon as five seconds from the current time). If the value is
|
84 | 84 | * a Date, it will be delayed at least until that Date occurs (i.e. the delay in that case
|
85 | 85 | * is equivalent to {@code headerDate.getTime() - new Date().getTime()}).
|
| 86 | + * <p> |
| 87 | + * Delayed messages are stored in the {@link MessageGroupStore} as a dedicated group. |
| 88 | + * If an external persistent store is provided, those delayed messages will be rescheduled |
| 89 | + * after application startup. |
| 90 | + * The {@link #messageGroupId} is required option and must be unique for each delayer |
| 91 | + * configuration to avoid work-stealing from the store and unexpected releases. |
| 92 | + * Different instances of the same delayer can point to the same message group in the store. |
| 93 | + * The {@link #messageGroupId} cannot rely on a bean name which might be generated. |
| 94 | + * After application restart the bean may get a different generated name and its delayed |
| 95 | + * messages might be lost from reschedule since its group is not managed |
| 96 | + * by the application anymore. |
86 | 97 | *
|
87 | 98 | * @author Mark Fisher
|
88 | 99 | * @author Artem Bilan
|
89 | 100 | * @author Gary Russell
|
90 | 101 | *
|
91 | 102 | * @since 1.0.3
|
92 | 103 | */
|
93 |
| - |
94 | 104 | @ManagedResource
|
95 | 105 | @IntegrationManagedResource
|
96 | 106 | public class DelayHandler extends AbstractReplyProducingMessageHandler implements DelayHandlerManagement,
|
@@ -132,7 +142,7 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement
|
132 | 142 |
|
133 | 143 | /**
|
134 | 144 | * Construct an instance with default options.
|
135 |
| - * The {@link #messageGroupId}must then be provided via the setter. |
| 145 | + * The {@link #messageGroupId} must then be provided via the setter. |
136 | 146 | * @since 6.2
|
137 | 147 | */
|
138 | 148 | public DelayHandler() {
|
@@ -165,6 +175,7 @@ public DelayHandler(String messageGroupId, TaskScheduler taskScheduler) {
|
165 | 175 |
|
166 | 176 | /**
|
167 | 177 | * Set a group id to manage delayed messages by this handler.
|
| 178 | + * Required. |
168 | 179 | * @param messageGroupId the group id for delayed messages.
|
169 | 180 | * @since 6.2
|
170 | 181 | */
|
|
0 commit comments