Outbound channel definition for event registry

I have a process that is meant to send a simple json message to my rabbitmq queue.

In modeler I’ve only used a “start event” and a “send event task” elements. For the sender I use two fields:

  1. event key: outboundEvent
  2. mapping to event payload:

My outbound channel definition:
{
“key”: “outboundCustomer”,
“category”: “channel”,
“name”: “Test outbound channel”,
“description”: “Test Outbound Channel”,
“channelType”: “outbound”,
“type”: “rabbit”,
“serializerType”: “json”,
“exchange”: “amq.fanout”
}

Obviously, I have an ‘amq.fanout’ exchange that is bound to my queue.

my event definition:
{
“key”: “outboundEvent”,
“name”: “outbound event for testing purposes”,
“outboundChannelKeys”: [
“outboundCustomer”
],
“payload”: [
{
“name”: “task”,
“type”: “string”
},
{
“name”: “email”,
“type”: “string”
}
]
}

My understanding is that all of that is enough to send a message to the queue, but instead either a process instance is finished, but there is no new message in the queue, or the process just breaks and gives the following error: org.flowable.common.engine.api.FlowableException : Could not find an outbound channel adapter for channel outboundCustomer.

What am I missing here ? How do I fix it, so it sends a message ? Also, is there a way to send a message directly to a queue bypassing any exchanges ?

  • Did you deploy both the channel definition and the event definition?
  • Can you share your bpmn xml, just to make sure nothing is missed?

@joram
1)yes, both definitions are placed in /src/main/resources/eventregistry directory.
2)my bpmn xml:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef">
  <process id="manualReportsAndRsync" name="manualReportsAndRsync" isExecutable="true">
    <documentation>manual start</documentation>
    <startEvent id="startEvent1" flowable:formFieldValidation="true"></startEvent>
    <serviceTask id="sendDisputeReport" name="prepare and send report document" flowable:type="send-event">
      <extensionElements>
        <flowable:eventType><![CDATA[outbound-event]]></flowable:eventType>
        <flowable:eventInParameter source="sendDisputeDownloadingReports" target="task" targetType="string"></flowable:eventInParameter>
        <flowable:eventInParameter source="blabla@gmail.com" target="email" targetType="string"></flowable:eventInParameter>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="sid-B28B7FD6-E754-43E6-AF4E-D3BA547D8711" sourceRef="startEvent1" targetRef="sendDisputeReport"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_manualReportsAndRsync">
    <bpmndi:BPMNPlane bpmnElement="manualReportsAndRsync" id="BPMNPlane_manualReportsAndRsync">
      <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
        <omgdc:Bounds height="30.0" width="30.0" x="90.0" y="261.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sendDisputeReport" id="BPMNShape_sendDisputeReport">
        <omgdc:Bounds height="102.0" width="136.0" x="300.0" y="225.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sid-B28B7FD6-E754-43E6-AF4E-D3BA547D8711" id="BPMNEdge_sid-B28B7FD6-E754-43E6-AF4E-D3BA547D8711">
        <omgdi:waypoint x="119.9499997356999" y="276.0"></omgdi:waypoint>
        <omgdi:waypoint x="300.0" y="276.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Also, here is my modified event:

{
  "key": "outbound-event",
  "name": "outbound event for testing purposes",
  "outboundChannelKeys": [
    "test-outbound-channel"
  ],
  "payload": [
    {
      "name": "task",
      "type": "string"
    },
    {
      "name": "email",
      "type": "string"
    }
  ]
}

And the channel:

{
  "key": "test-outbound-channel",
  "category": "channel",
  "name": "Test outbound channel",
  "description": "Test Outbound Channel",
  "channelType": "outbound",
  "type": "rabbit",
  "serializerType": "json",
  "exchange": "amq.topic",
  "routingKey":"outbound-key"
}

My queue is now bound to the amq.topic exchange trough the key: outbound-key.
In its current state the process always finishes, but never actually sends a message.

Thanks for sharing the models. Everything looks ok on first glance.

How are you running this?
If you’re running this through Flowable Task, did you enable Rabbit?

flowable.task.app.rabbit-enabled=true
spring.rabbitmq.addresses=localhost:5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest

@joram
I’m running it through Flowable Task. I have disabled rabbit in Task .properties file since I have it enabled in my flowable-spring-boot-application .yaml file. When I had rabbit enabled in both files, that always lead to one of them getting a timeout exception, so I assumed only the spring boot application needs it. Is this assumption wrong ?

I’ve also tried to make a process that is triggered by messages in my queue instead of sending them to it. The same spring boot application and UI apps configurations. And it works. So, it seems to me that rabbit configuration should be correct.

It only needs to be enabled on the Flowable-task side. If you have your own spring boot application, the Spring Boot rabbitmq classes on the classpath will make it kick in automatically.

So given the above - where does your process now run? In Flowable Task or in your Spring Boot application? Or both? I’m not sure I’m getting the full picture yet.

I have a spring boot application (where I have rabbit enabled through spring properties) with a flowable-spring-boot-starter dependency. Additionally, I have deployed 4 flowable UI applications(admin, task(where rabbit is disabled, since it always gets a timeout exception, if the spring boot app with enabled rabbit is running), idm, modeler) to Tomcat. My idea was that flowable will be running as a spring boot app, but I will use the UI apps to create, deploy and start processes (like the one I posted earlier).

Not sure what’s wrong, to be honest.

Do you have custom delegate code? Is the classpath the same on all instances?

There’s a helpful article here that shows a RabbitMQ+Flowable example: https://github.com/seletz/flowable-event-registry-demo