![激活规范批处理 MDB 处理](https://linux22.com/image/788327/%E6%BF%80%E6%B4%BB%E8%A7%84%E8%8C%83%E6%89%B9%E5%A4%84%E7%90%86%20MDB%20%E5%A4%84%E7%90%86.png)
我有一个 MQ 主题,其中的消息将在 2 小时后过期。在给定时间内,该主题上有数千条消息。
我在 Websphere 中使用 MDB 和激活规范来处理消息。激活规范配置了多个实例,以便可以并行处理消息。
Websphere 似乎每 5 秒分批读取消息,这看起来浪费了很多时间 - 例如:
[8/7/23 15:10:56:791 BST] 0000012d 1 Received message at 2023-08-07T15:10:56.791
[8/7/23 15:10:56:830 BST] 0000014f 1 Received message at 2023-08-07T15:10:56.830
[8/7/23 15:10:56:830 BST] 00000127 1 Received message at 2023-08-07T15:10:56.830
[8/7/23 15:10:56:966 BST] 00000132 1 Received message at 2023-08-07T15:10:56.966
[8/7/23 15:10:57:040 BST] 000000f4 1 Received message at 2023-08-07T15:10:57.040
[8/7/23 15:10:57:040 BST] 00000132 1 Received message at 2023-08-07T15:10:57.040
[8/7/23 15:10:57:040 BST] 0000012d 1 Received message at 2023-08-07T15:10:57.040
[8/7/23 15:10:57:040 BST] 00000157 1 Received message at 2023-08-07T15:10:57.040
[8/7/23 15:10:57:040 BST] 00000139 1 Received message at 2023-08-07T15:10:57.040
[8/7/23 15:10:57:040 BST] 0000014f 1 Received message at 2023-08-07T15:10:57.040
[8/7/23 15:11:02:421 BST] 0000015c 1 Received message at 2023-08-07T15:11:02.421
[8/7/23 15:11:02:456 BST] 00000127 1 Received message at 2023-08-07T15:11:02.456
[8/7/23 15:11:02:627 BST] 0000013b 1 Received message at 2023-08-07T15:11:02.627
[8/7/23 15:11:02:682 BST] 00000134 1 Received message at 2023-08-07T15:11:02.682
[8/7/23 15:11:02:756 BST] 0000014f 1 Received message at 2023-08-07T15:11:02.756
[8/7/23 15:11:02:767 BST] 00000157 1 Received message at 2023-08-07T15:11:02.767
[8/7/23 15:11:02:821 BST] 00000139 1 Received message at 2023-08-07T15:11:02.821
[8/7/23 15:11:06:967 BST] 000000f4 1 Received message at 2023-08-07T15:11:06.967
[8/7/23 15:11:07:025 BST] 0000012d 1 Received message at 2023-08-07T15:11:07.025
[8/7/23 15:11:07:036 BST] 0000015c 1 Received message at 2023-08-07T15:11:07.035
[8/7/23 15:11:07:092 BST] 0000013b 1 Received message at 2023-08-07T15:11:07.092
[8/7/23 15:11:07:122 BST] 00000134 1 Received message at 2023-08-07T15:11:07.122
[8/7/23 15:11:07:165 BST] 0000014f 1 Received message at 2023-08-07T15:11:07.165
[8/7/23 15:11:07:207 BST] 00000127 1 Received message at 2023-08-07T15:11:07.207
[8/7/23 15:11:07:247 BST] 00000139 1 Received message at 2023-08-07T15:11:07.247
[8/7/23 15:11:07:300 BST] 000000f4 1 Received message at 2023-08-07T15:11:07.300
[8/7/23 15:11:07:356 BST] 0000012d 1 Received message at 2023-08-07T15:11:07.356
[8/7/23 15:11:12:696 BST] 0000015c 1 Received message at 2023-08-07T15:11:12.696
[8/7/23 15:11:12:761 BST] 00000132 1 Received message at 2023-08-07T15:11:12.761
[8/7/23 15:11:12:827 BST] 00000134 1 Received message at 2023-08-07T15:11:12.827
[8/7/23 15:11:12:891 BST] 0000014f 1 Received message at 2023-08-07T15:11:12.891
[8/7/23 15:11:12:968 BST] 00000127 1 Received message at 2023-08-07T15:11:12.968
[8/7/23 15:11:18:327 BST] 0000015c 1 Received message at 2023-08-07T15:11:18.327
[8/7/23 15:11:18:359 BST] 0000015c 1 Received message at 2023-08-07T15:11:18.359
[8/7/23 15:11:18:359 BST] 00000127 1 Received message at 2023-08-07T15:11:18.359
[8/7/23 15:11:18:359 BST] 00000132 1 Received message at 2023-08-07T15:11:18.359
[8/7/23 15:11:18:364 BST] 0000012d 1 Received message at 2023-08-07T15:11:18.364
[8/7/23 15:11:18:368 BST] 00000127 1 Received message at 2023-08-07T15:11:18.368
[8/7/23 15:11:18:368 BST] 0000015c 1 Received message at 2023-08-07T15:11:18.368
[8/7/23 15:11:18:387 BST] 00000127 1 Received message at 2023-08-07T15:11:18.387
[8/7/23 15:11:18:423 BST] 00000157 1 Received message at 2023-08-07T15:11:18.423
[8/7/23 15:11:18:601 BST] 00000134 1 Received message at 2023-08-07T15:11:18.601
[8/7/23 15:11:18:645 BST] 0000014f 1 Received message at 2023-08-07T15:11:18.645
[8/7/23 15:11:18:673 BST] 0000014f 1 Received message at 2023-08-07T15:11:18.673
[8/7/23 15:11:18:709 BST] 0000013b 1 Received message at 2023-08-07T15:11:18.709
[8/7/23 15:11:18:745 BST] 00000139 1 Received message at 2023-08-07T15:11:18.745
[8/7/23 15:11:18:787 BST] 000000f4 1 Received message at 2023-08-07T15:11:18.787
[8/7/23 15:11:18:827 BST] 000000f4 1 Received message at 2023-08-07T15:11:18.827
[8/7/23 15:11:18:867 BST] 00000132 1 Received message at 2023-08-07T15:11:18.867
[8/7/23 15:11:18:901 BST] 0000012d 1 Received message at 2023-08-07T15:11:18.901
[8/7/23 15:11:21:992 BST] 00000127 1 Received message at 2023-08-07T15:11:21.992
[8/7/23 15:11:22:036 BST] 00000157 1 Received message at 2023-08-07T15:11:22.036
[8/7/23 15:11:22:085 BST] 00000134 1 Received message at 2023-08-07T15:11:22.085
[8/7/23 15:11:22:130 BST] 0000015c 1 Received message at 2023-08-07T15:11:22.130
[8/7/23 15:11:22:180 BST] 0000013b 1 Received message at 2023-08-07T15:11:22.180
[8/7/23 15:11:22:206 BST] 00000139 1 Received message at 2023-08-07T15:11:22.206
[8/7/23 15:11:22:218 BST] 000000f4 1 Received message at 2023-08-07T15:11:22.218
[8/7/23 15:11:22:262 BST] 0000014f 1 Received message at 2023-08-07T15:11:22.262
[8/7/23 15:11:22:300 BST] 0000012d 1 Received message at 2023-08-07T15:11:22.300
[8/7/23 15:11:22:336 BST] 00000127 1 Received message at 2023-08-07T15:11:22.336
[8/7/23 15:11:22:374 BST] 00000157 1 Received message at 2023-08-07T15:11:22.374
[8/7/23 15:11:26:414 BST] 00000134 1 Received message at 2023-08-07T15:11:26.414
[8/7/23 15:11:26:488 BST] 0000015c 1 Received message at 2023-08-07T15:11:26.488
[8/7/23 15:11:26:568 BST] 0000013b 1 Received message at 2023-08-07T15:11:26.568
[8/7/23 15:11:26:630 BST] 00000132 1 Received message at 2023-08-07T15:11:26.630
[8/7/23 15:11:26:698 BST] 000000f4 1 Received message at 2023-08-07T15:11:26.698
[8/7/23 15:11:32:124 BST] 0000014f 1 Received message at 2023-08-07T15:11:32.124
[8/7/23 15:11:32:195 BST] 0000012d 1 Received message at 2023-08-07T15:11:32.195
[8/7/23 15:11:32:214 BST] 00000157 1 Received message at 2023-08-07T15:11:32.214
[8/7/23 15:11:32:214 BST] 00000134 1 Received message at 2023-08-07T15:11:32.214
[8/7/23 15:11:32:214 BST] 00000132 1 Received message at 2023-08-07T15:11:32.214
[8/7/23 15:11:32:214 BST] 00000139 1 Received message at 2023-08-07T15:11:32.214
[8/7/23 15:11:32:215 BST] 000000f4 1 Received message at 2023-08-07T15:11:32.215
[8/7/23 15:11:32:218 BST] 000000f4 1 Received message at 2023-08-07T15:11:32.218
[8/7/23 15:11:32:251 BST] 00000134 1 Received message at 2023-08-07T15:11:32.251
[8/7/23 15:11:32:433 BST] 0000013b 1 Received message at 2023-08-07T15:11:32.433
[8/7/23 15:11:32:474 BST] 000000f4 1 Received message at 2023-08-07T15:11:32.474
我该如何配置激活规范,以免批次之间等待太长时间?
答案1
事实证明,AWS 使用的是突发 EFS,它限制了将消息写入 MQ 主题的速率——所以它与激活规范完全无关!