Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(engine): apply event sourcing to message publish processor
* use the state writer in the message publish processor to apply the state changes * extend the ES templates for the new record properties * disable the replay filter to restore the key generator for migrated processors
- Loading branch information
Showing
27 changed files
with
499 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
engine/src/main/java/io/zeebe/engine/state/appliers/MessagePublishedApplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.0. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.0. | ||
*/ | ||
package io.zeebe.engine.state.appliers; | ||
|
||
import io.zeebe.engine.state.TypedEventApplier; | ||
import io.zeebe.engine.state.message.Message; | ||
import io.zeebe.engine.state.mutable.MutableMessageState; | ||
import io.zeebe.protocol.impl.record.value.message.MessageRecord; | ||
import io.zeebe.protocol.record.intent.MessageIntent; | ||
|
||
public final class MessagePublishedApplier | ||
implements TypedEventApplier<MessageIntent, MessageRecord> { | ||
|
||
private final MutableMessageState messageState; | ||
|
||
public MessagePublishedApplier(final MutableMessageState messageState) { | ||
this.messageState = messageState; | ||
} | ||
|
||
@Override | ||
public void applyState(final long key, final MessageRecord value) { | ||
// TODO (saig0): reuse the message record in the state | ||
final var message = | ||
new Message( | ||
key, | ||
value.getNameBuffer(), | ||
value.getCorrelationKeyBuffer(), | ||
value.getVariablesBuffer(), | ||
value.getMessageIdBuffer(), | ||
value.getTimeToLive(), | ||
value.getDeadline()); | ||
|
||
messageState.put(message); | ||
} | ||
} |
Oops, something went wrong.