Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO_ISSUE: Fix Kafka examples README.md #1941

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ A quick reminder of what the original example was doing:
* if not processed traveller, info is logged and then process instance finishes sending a reply to a different Kafka topic

The functionality is still the same, but the format of the event, rather than being a cloudevent JSON format, it is a representation of the traveller object using Avro format. To help us deal with the serialization details,
[jackson-kafka-avro-serializer](https://github.com/productboardlabs/jackson-kafka-avro-serializer) dependency is added to `pom.xml`
`kie-addons-quarkus-marshallers-avro` dependency is added to `pom.xml`

```
<dependency>
<groupId>io.github.productboardlabs</groupId>
<artifactId>jackson-kafka-avro-serializer</artifactId>
<version>0.7.0</version>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-addons-quarkus-marshallers-avro</artifactId>
</dependency>
```

Expand Down
14 changes: 7 additions & 7 deletions kogito-quarkus-examples/process-kafka-multi-quarkus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ Content (cloud event format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "21627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "TravellersMessageDataEvent_3",
"time": "2022-02-24T13:25:16+0000",
"type": "travellers",
"time": "2022-02-24T13:25:16Z",
"data": {
"firstName" : "Jan",
"lastName" : "Kowalski",
Expand All @@ -182,7 +182,7 @@ Content (cloud event format)
One liner

```json
{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
```


Expand Down Expand Up @@ -212,7 +212,7 @@ this will then trigger the successful processing of the traveller and put anothe
}
```

there are bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer.
there is a bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer.

To take the other path of the process put following message on `travellers` topic

Expand All @@ -226,7 +226,7 @@ With the following content (Cloud Event Format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "31627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "travellers",
Expand All @@ -243,7 +243,7 @@ With the following content (Cloud Event Format)
One Liner

```json
{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
```

this will result in message being send to `cancelledtravelers` topic, according to this configuration
Expand Down
52 changes: 25 additions & 27 deletions kogito-quarkus-examples/process-kafka-quickstart-quarkus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ Content (cloud event format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "21627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "travellers",
"time": "2022-02-24T13:25:16+0000",
"time": "2022-02-24T13:25:16Z",
"data": {
"firstName" : "Jan",
"lastName" : "Kowalski",
Expand All @@ -175,37 +175,35 @@ Content (cloud event format)
One liner

```json
{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
```


this will then trigger the successful processing of the traveller and put another message on `processedtravellers` topic with following content (cloud event format)

```json
{
"specversion": "0.3",
"id": "86f69dd6-7145-4188-aeaa-e44622eeec86",
"source": "",
"type": "TravellersMessageDataEvent_3",
"time": "2019-10-03T16:22:40.373523+02:00[Europe/Warsaw]",
"data": {
"firstName": "Jan",
"lastName": "Kowalski",
"email": "jan.kowalski@example.com",
"nationality": "Polish",
"processed": true
},
"kogitoProcessinstanceId": "4fb091c2-82f7-4655-8687-245a4ab07483",
"kogitoParentProcessinstanceId": null,
"kogitoRootProcessinstanceId": null,
"kogitoProcessId": "Travellers",
"kogitoRootProcessId": null,
"kogitoProcessinstanceState": "1",
"kogitoReferenceId": null
"specversion": "1.0",
"id": "e84a4591-3581-42cd-bb2a-fac989ffd1a0",
"source": "/process/Travelers",
"type": "processedtravellers",
"time": "2024-06-05T11:30:49.722368+02:00",
"kogitoproctype": "BPMN",
"kogitoprocinstanceid": "66d1c981-9d6d-4c01-bc43-b712dc73b6cc",
"kogitoprocist": "Active",
"kogitoprocversion": "1.0",
"kogitoprocid": "Travelers",
"data": {
"firstName": "Jan",
"lastName": "Kowalski",
"email": "jan.kowalski@example.com",
"nationality": "Polish",
"processed": true
}
}
```

there are bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer.
there are a bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer.

To take the other path of the process put following message on `travellers` topic

Expand All @@ -219,11 +217,11 @@ With the following content (Cloud Event Format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "31627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "travellers",
"time": "2022-02-24T13:25:16+0000",
"time": "2022-02-24T13:25:16Z",
"data": {
"firstName" : "John",
"lastName" : "Doe",
Expand All @@ -236,7 +234,7 @@ With the following content (Cloud Event Format)
One Liner

```json
{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
```

this will not result in message being send to `processedtravelers` topic.
this will not result in message being sent to `processedtravelers` topic.
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ Content (cloud event format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "21627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "travellers",
"time": "2022-02-24T13:25:16+0000",
"type": "travellers",
"time": "2022-02-24T13:25:16Z",
"data": {
"firstName" : "Jan",
"lastName" : "Kowalski",
Expand All @@ -153,7 +153,7 @@ Content (cloud event format)
One liner

```json
{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
```

this will then trigger the successful processing of the traveller and put another message on `processedtravellers` topic.
Expand All @@ -169,11 +169,11 @@ With the following content (Cloud Event Format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "31627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "travellers",
"time": "2022-02-24T13:25:16+0000",
"time": "2022-02-24T13:25:16Z",
"data": {
"firstName" : "John",
"lastName" : "Doe",
Expand All @@ -186,7 +186,7 @@ With the following content (Cloud Event Format)
One Liner

```json
{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
```

this will result in message being send to `cancelledtravelers` topic.
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ Content (cloud event format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "21627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "travellers",
"time": "2022-02-24T13:25:16+0000",
"time": "2022-02-24T13:25:16Z",
"data": {
"firstName" : "Jan",
"lastName" : "Kowalski",
Expand All @@ -146,7 +146,7 @@ Content (cloud event format)
One liner

```json
{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}}
```

this will then trigger the successful processing of the traveller and put another message on `processedtravellers` topic.
Expand All @@ -162,11 +162,11 @@ With the following content (Cloud Event Format)

```json
{
"specversion": "0.3",
"specversion": "1.0",
"id": "31627e26-31eb-43e7-8343-92a696fd96b1",
"source": "",
"type": "travellers",
"time": "2022-02-24T13:25:16+0000",
"time": "2022-02-24T13:25:16Z",
"data": {
"firstName" : "John",
"lastName" : "Doe",
Expand All @@ -179,7 +179,7 @@ With the following content (Cloud Event Format)
One Liner

```json
{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}}
```

this will not result in message being send to `processedtravelers` topic.