Re: CloudEvent Kafka Message Ignored. Wrong type and trigger. Anti-pattern?

504 views
Skip to first unread message

Cristiano Nicolai

unread,
Mar 7, 2022, 4:14:49 AM3/7/22
to Kogito development mailing list
Hi Seth,

Exchanging messages between processes is completely fine and in general a good practice. There is also an example where we showcase this communication across processes: https://github.com/kiegroup/kogito-examples/tree/stable/kogito-quarkus-examples/kogito-travel-agency/extended

What could be happening to ignore the events is that you also need to set the message name ( which matches to the cloud event type ) in the intermediate message event in the bpmn model.

As for disabling cloud events, that is possible by setting  kogito.messaging.as-cloudevents=false in your application.properties but I would recommend keeping that unless extremely necessary to change.



On Tue, Mar 1, 2022 at 7:03 AM 'Seth Howard' via Kogito development mailing list <kogito-de...@googlegroups.com> wrote:
Couple questions:

I'm attempting to pass messages/data around to different process in the same project (Foo.bpmn2 triggers Bar.bpmn2). I'm wondering what the best pattern to do this is. 

My initial thought was Kafka. But using smallrye I'm unable to do both an incoming and outgoing on the same channel. eg.

mp.messaging.outgoing.barista-process.connector=smallrye-kafka
mp.messaging.outgoing.barista-process.value.serializer=org.apache.kafka.common.serialization.StringSerializer

mp.messaging.incoming.barista-process.connector=smallrye-kafka
mp.messaging.incoming.barista-process.value.deserializer=org.apache.kafka.common.serialization.StringSerializer

So, I attempted to skirt around this issue with:

mp.messaging.outgoing.barista-process.connector=smallrye-kafka
mp.messaging.outgoing.barista-process.topic=barista-process2
mp.messaging.outgoing.barista-process.value.serializer=org.apache.kafka.common.serialization.StringSerializer

mp.messaging.incoming.barista-process2.connector=smallrye-kafka
mp.messaging.incoming.barista-process2.topic=barista-process2
mp.messaging.incoming.barista-process2.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer

But end up getting:
2022-02-28 10:29:53,428 WARN  [org.kie.kog.eve.imp.CloudEventConsumer] (pool-1-thread-1) Consumer for CloudEvent type 'Barista_processMessageDataEvent_5', trigger 'barista-process2': ignoring message with type 'barista-process',  source '/process/drink_order_process'

First question, is there anyway to turn off cloud events, change the type, accept a different type, create a bean?

Second question, is this simply an anti-pattern and I should be doing cross bpmn through some other means that make more sense in the Kogito world? eg. Rest calls.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/6e92961f-5212-4587-b522-d9b67ce48ff4n%40googlegroups.com.


--
Best regards,

Cristiano Nicolai
Reply all
Reply to author
Forward
0 new messages