Commit aa9cdae
* GH-10760: Support topic filters in messages arrived callback
Fixes: #10760
The previous fix with protection against subscribed topics did not include
the logic about wildcard support in MQTT subscriptions
* Fix `MqttPahoMessageDrivenChannelAdapter` extracting `messageArrivedIfMatched()`
which would be called as a fallback common callback.
Delegate matching logic to the `MqttTopic.isMatched()` utility
* Fix `Mqttv5PahoMessageDrivenChannelAdapter` extracting `messageArrivedIfMatched()`
which would be called as a fallback common callback.
Delegate matching logic to the `MqttTopicValidator.isMatched()` utility.
However, before that check for the `$share/` prefix and strip two subscription parts.
Exactly the logic missed in Paho Client
* Modify `Mqttv5BackToBackTests.testSharedTopicMqttv5Interaction()` for wildcard to be sure
new matching logic works as expected
* Some MQTT MDChAs cleanup after review
Auto-cherry-pick to `7.0.x` & `6.5.x`**
1 parent cbafc03 commit aa9cdae
File tree
3 files changed
+36
-35
lines changed- spring-integration-mqtt/src
- main/java/org/springframework/integration/mqtt/inbound
- test/java/org/springframework/integration/mqtt
3 files changed
+36
-35
lines changedLines changed: 13 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
191 | | - | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | 377 | | |
386 | 378 | | |
387 | 379 | | |
| |||
451 | 443 | | |
452 | 444 | | |
453 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
454 | 457 | | |
455 | 458 | | |
456 | 459 | | |
| |||
Lines changed: 22 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
304 | | - | |
| 305 | + | |
| 306 | + | |
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
310 | 315 | | |
311 | 316 | | |
312 | 317 | | |
| |||
325 | 330 | | |
326 | 331 | | |
327 | 332 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
| |||
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
386 | | - | |
387 | 388 | | |
388 | 389 | | |
389 | 390 | | |
| |||
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | 402 | | |
408 | 403 | | |
409 | 404 | | |
| |||
438 | 433 | | |
439 | 434 | | |
440 | 435 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | 436 | | |
453 | 437 | | |
454 | 438 | | |
| |||
550 | 534 | | |
551 | 535 | | |
552 | 536 | | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
553 | 551 | | |
554 | 552 | | |
555 | 553 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
0 commit comments