On 5/29/26 17:00, 'Eric Deandrea' via Quarkus Development mailing list
wrote:
> Bill and I are just trying to think of the best solution for our use case.
>
> In some instances, the flow should be synchronous, but in others it
> should be async. So maybe the better approach is just fire sync and the
> consumer can do the threading themselves if they want async.
But if the flow should be async then you can't leave it to the
consumers. That does not make sense.
>
> Not that it matters, but in Spring this is not an issue. The producer
> just fires the event. It’s up to each consumer to decide whether they
> want to receive it sync or async. You can even have multiple consumers
> of the event that handle it differently.
One of the consequence is that for sync notifications you don't need to
care about concurrent access for mutable payload. If you have immutable
payload (best practice IMO) then you don't care obviously.
>
> The publishing of the event itself always happens on the same thread as
> the code producing the event, but then the threading delegation is
> handled just before the event is delivered to the consumer.>
>
> Eric Deandrea
>
> Java Champion
>
> Senior Principal Software Engineer
>
> Quarkus | LangChain4j | Docling-Java
>
> On May 29, 2026 at 10:50:08 AM, 'Martin Kouba' via Quarkus Development
> mailing list <
quark...@googlegroups.com <mailto:
quarkus-
>
d...@googlegroups.com>> wrote:
>>
>>
>> On 5/29/26 16:26, 'Matej Novotny' via Quarkus Development mailing list
>> wrote:
>>> I wouldn't say it is necessarily a bad pattern but it is uncommon.
>>> Most of the time, it is just like Martin says - you pick one or the
>>> other based on whether you want/expect it to be blocking.
>>> That said, I do recall us firing both somewhere - StatusEmitterInvoker
>>> in scheduler extension I think?
>>> But since you are talking CDI spec events, the most important part is to
>>> properly document that you fire sync or async event at certain point in
>>> time so users know how to observe them.
>>>
>>> > Would a “proper” approach be to fire synchronously, and if the
>>> consumer doesn’t want to block, they can manage the threading themselves?
>>>
>>> Unfortunately, as far as CDI goes, we have our hands bound unless we
>>> decide to break the whole eventing system :)
>>> The new Signals extension would offer the flexibility you are talking
>>> about.
>>
>> Yes, because in Signals, all receivers are always notified
>> asynchronously. So it never blocks the signal emitter unless explicitly
>> required.
>>
>>>
>>> On Fri, May 29, 2026 at 4:02 PM 'Chris Cranford' via Quarkus Development
>>> mailing list <
quark...@googlegroups.com <mailto:
quarkus-
>>>
d...@googlegroups.com> <mailto:
quarkus- <mailto:
quarkus->
>>>
d...@googlegroups.com <mailto:
d...@googlegroups.com>>> wrote:
>>>
>>> __
>>> Hi Eric, I would argue its not always about how the consumer wants
>>> to receive the event, but also the context in which the producer
>>> emits the event. If a producer bean observes an event that itself
>>> raises from within a @PostConstruct handler, you're forced to use
>>> asynchronous to avoid StackOverflow (observer recreates a new bean
>>> because the PostConstruct on the bean isn't yet done), or create two
>>> independent beans to handle a single concern.
>>>
>>> On 5/29/26 9:53 AM, 'Eric Deandrea' via Quarkus Development mailing
>>> list wrote:
>>> >
>>> >
>>> > Eric Deandrea
>>> >
>>> > Java Champion
>>> >
>>> > Senior Principal Software Engineer
>>> >
>>> > Quarkus | LangChain4j | Docling-Java
>>> >
>>> > Red Hat <
https://www.redhat.com/ <
https://www.redhat.com/>>
>>> >
>>> >
edea...@redhat.com <mailto:
edea...@redhat.com>
>>> <mailto:
edea...@redhat.com <mailto:
edea...@redhat.com>>
>>> M:
603.453.5840
>>> >
>>> > <
https://red.ht/sig <
https://red.ht/sig>>
>>> > <mailto:
quark...@googlegroups.com <mailto:
quarkus-
>>> blob/ <
https://github.com/quarkusio/quarkus/blob/>
>>> <
http://github.com/quarkusio/quarkus/blob/main/core/runtime/src/main/>
>>> >>> <mailto:
quarkus-dev%2Bunsu...@googlegroups.com
>>> <mailto:
quarkus-dev%252Buns...@googlegroups.com>>
>>> >>> <mailto:
quarkus- <mailto:
quarkus-> <mailto:
quarkus-
>>> >>> <mailto:
dev%2Bunsu...@googlegroups.com
>>> <mailto:
dev%252Buns...@googlegroups.com>>>.
>>> msgid/ <
https://groups.google.com/d/msgid/>
>>> CAL%3DE%3DjRoDB1f13SydXUHViUzYeRcctkiS4upmWaVMttgFx5pjA%
40mail.gmail.com <
http://40mail.gmail.com> <
http://40mail.gmail.com <
http://40mail.gmail.com>>
>>> >>> <
https://groups.google.com/d/msgid/quarkus-dev/ <https://
>>>
groups.google.com/d/msgid/quarkus-dev/> <https://
>>> >>>
groups.google.com/d/msgid/quarkus-dev/ <
http://groups.google.com/
>>> d/msgid/quarkus-dev/>>
>>> >>>
>>> CAL%3DE%3DjRoDB1f13SydXUHViUzYeRcctkiS4upmWaVMttgFx5pjA%
40mail.gmail.com?utm_medium=email&utm_source=footer <
http://40mail.gmail.com?utm_medium=email&utm_source=footer> <
http://40mail.gmail.com?utm_medium=email&utm_source=footer <
http://40mail.gmail.com?utm_medium=email&utm_source=footer>>>.
>>> >> <mailto:
quarkus-dev%2Bunsu...@googlegroups.com
>>> <mailto:
quarkus-dev%252Buns...@googlegroups.com>>.
>>> msgid/ <
https://groups.google.com/d/msgid/>
>>> >> quarkus-dev/872ea557-4bcd-4d9f-b2a7-954ed2d860fa%
40redhat.com
>>> <
http://40redhat.com>
>>> >> <
https://groups.google.com/d/msgid/quarkus- <https://
>>>
groups.google.com/d/msgid/quarkus->
>>> >> dev/872ea557-4bcd-4d9f-b2a7-954ed2d860fa%
40redhat.com
>>> <
http://40redhat.com>>.
>>> > <mailto:
quarkus-dev...@googlegroups.com
>>> msgid/ <
https://groups.google.com/d/msgid/>
>>> > quarkus-dev/CAOTfCRWWueCNnTfoch6rB-dJh0-q6FjaeuCN8nT-
>>> > nEK%2BzuuO0A%
40mail.gmail.com <
http://40mail.gmail.com>
>>> <
https://groups.google.com/d/msgid/ <
https://groups.google.com/d/msgid/>
>>> > quarkus-dev/CAOTfCRWWueCNnTfoch6rB-dJh0-q6FjaeuCN8nT-
>>> > nEK%2BzuuO0A%
40mail.gmail.com?
>>> utm_medium=email&utm_source=footer <
http://40mail.gmail.com?
>>> utm_medium=email&utm_source=footer>>.
>>>
>>> --
>>>
>>> Chris Cranford
>>>
>>> Principal Software Engineer
>>>
>>> APIs, Events, & Integration - Debezium
>>>
>>>
ccra...@redhat.com <mailto:
ccra...@redhat.com>
>>> <mailto:
ccra...@redhat.com <mailto:
ccra...@redhat.com>>
>>> <mailto:
quarkus-dev%2Bunsu...@googlegroups.com>
>>> <mailto:
quarkus-dev...@googlegroups.com <mailto:
quarkus-
>>> <
https://groups.google.com/d/msgid/>
>>> quarkus-dev/601ccb89-04a6-4499-985d-07415c75490d%
40redhat.com
>>> <
http://40redhat.com>
>>> <
https://groups.google.com/d/msgid/quarkus- <https://
>>>
groups.google.com/d/msgid/quarkus->
>>> dev/601ccb89-04a6-4499-985d-07415c75490d%
40redhat.com
>>> <
http://40redhat.com>?
>>> utm_medium=email&utm_source=footer>.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Quarkus Development mailing list" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to
quarkus-dev...@googlegroups.com <mailto:
quarkus-
>>> CAK6NyhAkt7iGTz5thbak98oK%2B4cHxUOBuSFzN89iJF_GmLue9g%
40mail.gmail.com <
http://40mail.gmail.com>
>>> CAK6NyhAkt7iGTz5thbak98oK%2B4cHxUOBuSFzN89iJF_GmLue9g%
40mail.gmail.com <
http://40mail.gmail.com>?
>>> utm_medium=email&utm_source=footer>.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Quarkus Development mailing list" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to
quarkus-dev...@googlegroups.com <mailto:
quarkus-
>> quarkus-dev/da4a3eb9-c777-4a1c-b70d-cf8a09ebc677%
40redhat.com
>> <
https://groups.google.com/d/msgid/quarkus-dev/da4a3eb9-c777-4a1c-
>> b70d-cf8a09ebc677%
40redhat.com>.
> dev/CAOTfCRUAemUOYQ3YNF3d3JnmwV7RMscsBiAJ1_Q7hVomO_cnKQ%
40mail.gmail.com
> <
https://groups.google.com/d/msgid/quarkus-dev/
> CAOTfCRUAemUOYQ3YNF3d3JnmwV7RMscsBiAJ1_Q7hVomO_cnKQ%
40mail.gmail.com?
> utm_medium=email&utm_source=footer>.