Commit 84e9f38
committed
GH-855 - Support to add headers in event externalization.
EventExternalizationConfiguration now exposes a ….headers(Class<T>, Function<T, Map<String, Object>) to allow to define a function that extracts headers from the event that are supposed to added to the message to be sent out. The Kafka and AMQP implementations have been augmented to consider those configurations.
Furthermore, if the mapping step prior to the externalization creates a Spring Message<?>, we add routing information as fallback and send it out as is.1 parent 7478347 commit 84e9f38
File tree
10 files changed
+193
-28
lines changed- spring-modulith-events
- spring-modulith-events-amqp/src/main/java/org/springframework/modulith/events/amqp
- spring-modulith-events-api/src
- main/java/org/springframework/modulith/events
- test/java/org/springframework/modulith/events
- spring-modulith-events-kafka/src
- main
- java/org/springframework/modulith/events/kafka
- resources
- test/java/org/springframework/modulith/events/kafka
- spring-modulith-events-messaging/src/main/java/org/springframework/modulith/events/messaging
- spring-modulith-examples/spring-modulith-example-kafka/src/test/java/example
10 files changed
+193
-28
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
98 | 114 | | |
Lines changed: 71 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
191 | 202 | | |
192 | 203 | | |
193 | 204 | | |
| |||
367 | 378 | | |
368 | 379 | | |
369 | 380 | | |
| 381 | + | |
370 | 382 | | |
371 | 383 | | |
372 | 384 | | |
373 | 385 | | |
374 | 386 | | |
375 | 387 | | |
376 | 388 | | |
| 389 | + | |
377 | 390 | | |
378 | | - | |
| 391 | + | |
| 392 | + | |
379 | 393 | | |
380 | 394 | | |
381 | 395 | | |
382 | 396 | | |
| 397 | + | |
383 | 398 | | |
384 | 399 | | |
385 | 400 | | |
386 | 401 | | |
| 402 | + | |
387 | 403 | | |
388 | 404 | | |
389 | 405 | | |
| |||
392 | 408 | | |
393 | 409 | | |
394 | 410 | | |
395 | | - | |
| 411 | + | |
396 | 412 | | |
397 | 413 | | |
398 | 414 | | |
| |||
406 | 422 | | |
407 | 423 | | |
408 | 424 | | |
409 | | - | |
| 425 | + | |
410 | 426 | | |
411 | 427 | | |
412 | 428 | | |
| |||
428 | 444 | | |
429 | 445 | | |
430 | 446 | | |
431 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
432 | 483 | | |
433 | 484 | | |
434 | 485 | | |
| |||
437 | 488 | | |
438 | 489 | | |
439 | 490 | | |
440 | | - | |
| 491 | + | |
441 | 492 | | |
442 | 493 | | |
443 | 494 | | |
| |||
450 | 501 | | |
451 | 502 | | |
452 | 503 | | |
453 | | - | |
| 504 | + | |
454 | 505 | | |
455 | 506 | | |
456 | 507 | | |
| |||
466 | 517 | | |
467 | 518 | | |
468 | 519 | | |
469 | | - | |
| 520 | + | |
470 | 521 | | |
471 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
472 | 525 | | |
473 | 526 | | |
474 | 527 | | |
| |||
487 | 540 | | |
488 | 541 | | |
489 | 542 | | |
490 | | - | |
| 543 | + | |
491 | 544 | | |
492 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
493 | 548 | | |
494 | 549 | | |
495 | 550 | | |
| |||
503 | 558 | | |
504 | 559 | | |
505 | 560 | | |
506 | | - | |
507 | | - | |
508 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
509 | 564 | | |
510 | 565 | | |
511 | 566 | | |
| |||
533 | 588 | | |
534 | 589 | | |
535 | 590 | | |
536 | | - | |
| 591 | + | |
537 | 592 | | |
538 | 593 | | |
539 | 594 | | |
540 | | - | |
| 595 | + | |
541 | 596 | | |
542 | 597 | | |
543 | 598 | | |
544 | 599 | | |
545 | | - | |
| 600 | + | |
546 | 601 | | |
547 | 602 | | |
548 | 603 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
133 | 150 | | |
134 | 151 | | |
135 | 152 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
65 | 78 | | |
66 | 79 | | |
67 | 80 | | |
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
0 commit comments