Skip to content

Commit 917e77e

Browse files
author
vtiwari5
committed
Add execution ID for new example
Signed-off-by: vtiwari5 <[email protected]>
1 parent 32a6020 commit 917e77e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

examples/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,28 @@
381381
</to>
382382
</configuration>
383383
</execution>
384+
<execution>
385+
<id>on-success-sink</id>
386+
<phase>package</phase>
387+
<goals>
388+
<goal>dockerBuild</goal>
389+
</goals>
390+
<configuration>
391+
<from>
392+
<image>amazoncorretto:11</image>
393+
</from>
394+
<container>
395+
<mainClass>
396+
io.numaproj.numaflow.examples.sink.onsuccess.OnSuccess
397+
</mainClass>
398+
</container>
399+
<to>
400+
<image>
401+
numaflow-java-examples/on-success-sink:${docker.tag}
402+
</image>
403+
</to>
404+
</configuration>
405+
</execution>
384406
</executions>
385407
</plugin>
386408
</plugins>

examples/src/main/java/io/numaproj/numaflow/examples/sink/onsuccess/OnSuccess.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ public ResponseList processMessages(DatumIterator datumIterator) {
5555
return responseListBuilder.build();
5656
}
5757

58+
/**
59+
* Example method to simulate write failures/success to primary sink.
60+
* Based on whether this returns true/false, we write to fallback sink / onSuccess sink
61+
* @return
62+
*/
5863
public boolean writeToPrimarySink() {
5964
Random random = new Random();
6065
return random.nextBoolean();

0 commit comments

Comments
 (0)