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

Event catching error for intermediate event in spring boot #3363

Closed
sandeepchaudhary1093 opened this issue Jan 22, 2024 · 9 comments · Fixed by #3368
Closed

Event catching error for intermediate event in spring boot #3363

sandeepchaudhary1093 opened this issue Jan 22, 2024 · 9 comments · Fixed by #3368
Assignees

Comments

@sandeepchaudhary1093
Copy link

Describe the bug

Ref: https://blog.kie.org/2021/09/kogito-process-eventing-add-ons.html#comment-357

Regarding : kogito-process-eventing-add-ons
Issue on build tool : spring boot
issue: There is an issue in SpringBoot receiver class, which only listen for topics on default channel and ignore any other one.

For catching intermediate event in workflow with spring boot, i had provided below properties

kogito.addon.cloudevents.kafka.kogito_incoming_stream=start
kogito.addon.cloudevents.kafka.kogito_incoming_stream.intermediate=intermediate
kogito.addon.cloudevents.kafka.kogito_outgoing_stream=end

now after starting the workflow with “start” topic message, when i send a message to “intermediate” topic with the process instance id and type=”intermediate”, the workflow doesn’t recognise it.

However if I send the same message to “start” topic with process inst id and type=”intermediate” then the message gets caught and the workflow continues.

So only incoming and outgoing properties are recognised not the node specific(intermediate).

Expected behavior

For :
kogito.addon.cloudevents.kafka.kogito_incoming_stream=start
kogito.addon.cloudevents.kafka.kogito_incoming_stream.intermediate=intermediate

Event sent to "intermediate" topic with process instance id should be caught by workflow and workflow should progress.

Actual behavior

Only while sending event to "start" topic with "type": "intermediate" and process inst id works.

Events sent to "intermediate" topic are not recognised by workflow.

How to Reproduce?

  1. add a bpmn2 file with start, end and intermediate message event.
  2. send event to start message and then to intermediate event node.
  3. event to intermediate gets ignored.

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@fjtirado
Copy link
Contributor

As described, multiple channels for springboot is not working as expected. We need to generate different receivers. Working on it

@fjtirado fjtirado mentioned this issue Jan 23, 2024
fjtirado added a commit that referenced this issue Jan 24, 2024
* [Fix_#3363] Allowing multiple topic for kafka listener

* [Fix_#3663] Manual ack and not thread blocking approach
@github-project-automation github-project-automation bot moved this from 📋 Backlog to 🎯 Done in 🦉 KIE Podling Board Jan 24, 2024
@sandeepchaudhary1093
Copy link
Author

sandeepchaudhary1093 commented Jan 24, 2024

@fjtirado Thanks for fixing the issue , may i know when would it be available and in which version of kogito/dependency ?

@fjtirado
Copy link
Contributor

Tomorrow, you can try updating snapshot, make sure that in your example you are using 999-SNAPSHOT as kogito version

rgdoliveira pushed a commit to rgdoliveira/kogito-runtimes that referenced this issue Jan 25, 2024
* [Fix_#3363] Allowing multiple topic for kafka listener

* [Fix_#3663] Manual ack and not thread blocking approach
@sandeepchaudhary1093
Copy link
Author

sandeepchaudhary1093 commented Feb 1, 2024

Hi @fjtirado ,

I was trying to add 999-SNAPSHOT version a for Kogito but was getting straightaway erros in compilation.

Did you mean below version or add-on dependency version? Could you please explain in detail, thanks in advance.

Screenshot 2024-02-01 at 4 52 09 PM

Adding pom file :

<?xml version="1.0" encoding="UTF-8"?>
 <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.kie.kogito.examples</groupId>
    <artifactId>kogito-springboot-examples</artifactId>
    <version>2.0.0-SNAPSHOT</version>
  </parent>

  <artifactId>process-postgresql-persistence-springboot</artifactId>
  <name>Kogito Example :: Process PostgreSQL Persistence Spring Boot</name>
  <description>Kogito with PostgreSQL persistence - Spring Boot</description>

  <properties>
    <version.org.kie.kogito>2.0.0-SNAPSHOT</version.org.kie.kogito>
    <kogito.bom.version>2.0.0-SNAPSHOT</kogito.bom.version>
  </properties>

  <dependencyManagement>
    <dependencies>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-spring-boot-bom</artifactId>
      <version>${kogito.bom.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <!-- kogito -->
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-processes-spring-boot-starter</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-addons-springboot-persistence-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-addons-springboot-messaging</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-spring-boot-test-utils</artifactId>
      <version>${version.org.kie.kogito}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${version.org.springframework.boot}</version>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.kie.kogito</groupId>
        <artifactId>kogito-maven-plugin</artifactId>
        <version>${version.org.kie.kogito}</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>events</id>
      <activation>
        <property>
          <name>events</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.kie.kogito</groupId>
          <artifactId>kogito-addons-springboot-events-process-kafka</artifactId>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>



@fjtirado
Copy link
Contributor

fjtirado commented Feb 1, 2024

All of them

@sandeepchaudhary1093
Copy link
Author

Getting below error :

Screenshot 2024-02-01 at 5 40 37 PM

@fjtirado
Copy link
Contributor

fjtirado commented Feb 1, 2024

Ok, probably this is related with the repository you are using, make sure that in your pom.xml you have

    <!-- Bootstrap repository to locate the parent pom when the parent pom has not been build locally. -->
    <repository>
        <id>apache-public-repository-group</id>
        <name>Apache Public Repository Group</name>
        <url>https://repository.apache.org/content/groups/public/</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
        </snapshots>
    </repository>
  </repositories>

@sandeepchaudhary1093
Copy link
Author

This worked, thanks a lot @fjtirado.

In which Kogito version can we expect this feature to be released in ?

@fjtirado
Copy link
Contributor

fjtirado commented Feb 1, 2024

@sandeepchaudhary1093
I do not know which is the release schedule (and honestly I prefer to live in ignorance regarding that)
Please ask here https://kie.zulipchat.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants