-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
253893a
commit ccc9ec5
Showing
48 changed files
with
409 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package common | ||
|
||
const QueueName = "orders-queue" | ||
|
||
// Order represents a fictitious order. | ||
type Order struct { | ||
OrderNumber int `json:"orderNumber"` | ||
Customer string `json:"customer"` | ||
OrderStatus string `json:"orderStatus"` | ||
OrderTotal float32 `json:"orderTotal"` | ||
CreateTime int64 `json:"createTime"` | ||
CompleteTime int64 `json:"completeTime"` | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
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> | ||
|
||
<groupId>com.oracle.coherence.demo</groupId> | ||
<artifactId>queues-demo</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0.0</version> | ||
|
||
<description>Oracle Coherence Queues Demo</description> | ||
<name>queues-demo</name> | ||
|
||
<properties> | ||
<revision>1.0.0</revision> | ||
<operator.version>${project.version}</operator.version> | ||
|
||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
|
||
<coherence.group.id>com.oracle.coherence.ce</coherence.group.id> | ||
<coherence.version>24.03</coherence.version> | ||
|
||
<coherence.test.base.image>gcr.io/distroless/java17</coherence.test.base.image> | ||
|
||
<!-- library dependency versions --> | ||
<version.plugin.jib>3.4.2</version.plugin.jib> | ||
<version.plugin.maven.assembly>3.3.0</version.plugin.maven.assembly> | ||
<version.plugin.maven.compiler>3.7.0</version.plugin.maven.compiler> | ||
|
||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>${coherence.group.id}</groupId> | ||
<artifactId>coherence</artifactId> | ||
<version>${coherence.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${coherence.group.id}</groupId> | ||
<artifactId>coherence-json</artifactId> | ||
<version>${coherence.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${coherence.group.id}</groupId> | ||
<artifactId>coherence-grpc-proxy</artifactId> | ||
<version>${coherence.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.google.cloud.tools</groupId> | ||
<artifactId>jib-maven-plugin</artifactId> | ||
<version>${version.plugin.jib}</version> | ||
<configuration> | ||
<from> | ||
<image>${coherence.test.base.image}</image> | ||
</from> | ||
<to> | ||
<image>${project.artifactId}-${coherence.version}</image> | ||
</to> | ||
<container> | ||
<jvmFlags> | ||
<jvmFlag>-Xmx1g</jvmFlag> | ||
<jvmFlag>-Xms1g</jvmFlag> | ||
<jvmFlag>-Dcoherence.grpc.server.port=1408</jvmFlag> | ||
<jvmFlag>-Dcoherence.wka=127.0.0.1</jvmFlag> | ||
<jvmFlag>-Dcoherence.localhost=127.0.0.1</jvmFlag> | ||
<jvmFlag>-Dcoherence.ttl=0</jvmFlag> | ||
<jvmFlag>-Djava.net.preferIPv4Stack=true</jvmFlag> | ||
<jvmFlag>-Dcoherence.management=all</jvmFlag> | ||
<jvmFlag>-Dcoherence.management.http=all</jvmFlag> | ||
</jvmFlags> | ||
<mainClass>com.oracle.coherence.demo.queues.RunCoherence</mainClass> | ||
<format>OCI</format> | ||
</container> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17"> | ||
<output url="file://$MODULE_DIR$/target/classes" /> | ||
<output-test url="file://$MODULE_DIR$/target/test-classes" /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="Maven: com.oracle.coherence.ce:coherence:24.03" level="project" /> | ||
<orderEntry type="library" name="Maven: jakarta.el:jakarta.el-api:5.0.1" level="project" /> | ||
<orderEntry type="library" name="Maven: com.oracle.coherence.ce:coherence-json:24.03" level="project" /> | ||
<orderEntry type="library" name="Maven: jakarta.json.bind:jakarta.json.bind-api:3.0.0" level="project" /> | ||
<orderEntry type="library" name="Maven: jakarta.json:jakarta.json-api:2.1.3" level="project" /> | ||
<orderEntry type="library" name="Maven: jakarta.inject:jakarta.inject-api:2.0.1" level="project" /> | ||
<orderEntry type="library" name="Maven: com.oracle.coherence.ce:coherence-grpc-proxy:24.03" level="project" /> | ||
<orderEntry type="library" name="Maven: com.oracle.coherence.ce:coherence-grpc-proxy-common:24.03" level="project" /> | ||
<orderEntry type="library" name="Maven: com.oracle.coherence.ce:coherence-grpc:24.03" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-api:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-stub:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-protobuf:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.api.grpc:proto-google-common-protos:2.22.0" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-protobuf-lite:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:2.1.1" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.21.12" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java-util:3.21.12" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-services:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-util:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:2.8" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.10.1" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-inprocess:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.100.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-netty:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: io.grpc:grpc-core:1.60.0" level="project" /> | ||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.google.android:annotations:4.1.1.4" level="project" /> | ||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.23" level="project" /> | ||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.grpc:grpc-context:1.60.0" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.guava:guava:32.0.1-android" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.33.0" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.20.0" level="project" /> | ||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.perfmark:perfmark-api:0.26.0" level="project" /> | ||
</component> | ||
</module> |
110 changes: 110 additions & 0 deletions
110
go/queues/java/src/main/java/com/oracle/coherence/demo/queues/Order.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,110 @@ | ||
package com.oracle.coherence.demo.queues; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
public class Order implements Serializable { | ||
private int orderNumber; | ||
private String customer; | ||
private String orderStatus; | ||
private float orderTotal; | ||
private long createTime; | ||
private long completeTime; | ||
|
||
public Order() {} | ||
|
||
public Order(int orderNumber, String customer, String orderStatus, float orderTotal, long createTime, long completeTime) { | ||
this.orderNumber = orderNumber; | ||
this.customer = customer; | ||
this.orderStatus = orderStatus; | ||
this.orderTotal = orderTotal; | ||
this.createTime = createTime; | ||
this.completeTime = completeTime; | ||
} | ||
|
||
public int getOrderNumber() { | ||
return orderNumber; | ||
} | ||
|
||
public void setOrderNumber(int orderNumber) { | ||
this.orderNumber = orderNumber; | ||
} | ||
|
||
public String getCustomer() { | ||
return customer; | ||
} | ||
|
||
public void setCustomer(String customer) { | ||
this.customer = customer; | ||
} | ||
|
||
public String getOrderStatus() { | ||
return orderStatus; | ||
} | ||
|
||
public void setOrderStatus(String orderStatus) { | ||
this.orderStatus = orderStatus; | ||
} | ||
|
||
public float getOrderTotal() { | ||
return orderTotal; | ||
} | ||
|
||
public void setOrderTotal(float orderTotal) { | ||
this.orderTotal = orderTotal; | ||
} | ||
|
||
public long getCreateTime() { | ||
return createTime; | ||
} | ||
|
||
public void setCreateTime(long createTime) { | ||
this.createTime = createTime; | ||
} | ||
|
||
public long getCompleteTime() { | ||
return completeTime; | ||
} | ||
|
||
public void setCompleteTime(long completeTime) { | ||
this.completeTime = completeTime; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
Order order = (Order) o; | ||
|
||
if (orderNumber != order.orderNumber) return false; | ||
if (Float.compare(order.orderTotal, orderTotal) != 0) return false; | ||
if (createTime != order.createTime) return false; | ||
if (completeTime != order.completeTime) return false; | ||
if (!Objects.equals(customer, order.customer)) return false; | ||
return Objects.equals(orderStatus, order.orderStatus); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = orderNumber; | ||
result = 31 * result + (customer != null ? customer.hashCode() : 0); | ||
result = 31 * result + (orderStatus != null ? orderStatus.hashCode() : 0); | ||
result = 31 * result + (orderTotal != +0.0f ? Float.floatToIntBits(orderTotal) : 0); | ||
result = 31 * result + (int) (createTime ^ (createTime >>> 32)); | ||
result = 31 * result + (int) (completeTime ^ (completeTime >>> 32)); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Order{" + | ||
"orderNumber=" + orderNumber + | ||
", customer='" + customer + '\'' + | ||
", orderStatus='" + orderStatus + '\'' + | ||
", orderTotal=" + orderTotal + | ||
", createTime=" + createTime + | ||
", completeTime=" + completeTime + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.