public class ProducerService extends Object implements Serializable
The kafka producer is thread safe and sharing a single producer instance across threads will generally be faster than having multiple instances. For that reason we use a @Singleton with @ConcurrencyManagement
The producer consists of a pool of buffer space that holds records that haven't yet been transmitted to the server as well as a background I/O thread that is responsible for turning these records into requests and transmitting them to the cluster. Failure to close the producer after use will leak these resources.
| Constructor and Description |
|---|
ProducerService() |
| Modifier and Type | Method and Description |
|---|---|
void |
onProcess(org.imixs.workflow.engine.ProcessingEvent documentEvent)
Autowire:
On each workflow process event a new message is generated if the workflow
model version matches the setup.
|
void |
sendWorkitem(org.imixs.workflow.ItemCollection workitem)
This method sends a kafka message based on a given workitem.
|
public void onProcess(@Observes
org.imixs.workflow.engine.ProcessingEvent documentEvent)
On each workflow process event a new message is generated if the workflow model version matches the setup.
public void sendWorkitem(org.imixs.workflow.ItemCollection workitem)
throws org.imixs.workflow.exceptions.AdapterException
The topic ofi the message is the model version
The value is a serialized version of the workitem.
workitem - org.imixs.workflow.exceptions.AdapterExceptionCopyright © 2020 Imixs Software Solutions GmbH. All rights reserved.