JiriOndrusek commented on code in PR #3919:
URL: https://github.com/apache/camel-quarkus/pull/3919#discussion_r937400212
##########
integration-tests/google-pubsub/src/main/java/org/apache/camel/quarkus/component/google/pubsub/it/GooglePubsubResource.java:
##########
@@ -64,7 +82,95 @@ public Response sendPojoToTopic(String fruitName) {
@Produces(MediaType.APPLICATION_JSON)
public Response consumePojoFromTopic() {
Object response = consumerTemplate
-
.receiveBody("google-pubsub:{{project.id}}:{{subscription.name}}?synchronousPull=true",
5000L);
+
.receiveBody("google-pubsub:{{project.id}}:{{google-pubsub.subscription-name}}?synchronousPull=false",
5000L);
return Response.ok(response).build();
}
+
+ @Path("/sendToEndpoint")
+ @POST
+ public Response sentToEndpoint(String message,
+ @QueryParam("toEndpoint") String toEndpoint)
+ throws Exception {
+ producerTemplate.sendBody(toEndpoint, message);
+ return
Response.created(URI.create("https://camel.apache.org")).build();
+ }
+
+ @Path("/getFromEndpoint")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String getSchedulerResult(@QueryParam("fromEndpoint") String
fromEndpoint) throws Exception {
+ return consumerTemplate.receiveBody(fromEndpoint, 5000, String.class);
+ }
+
+ @Path("receive/subscription/{subscriptionName}")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String receiveFromSubscription(@PathParam("subscriptionName")
String subscriptionName) throws Exception {
+ return consumeEndpoint(subscriptionName, null);
+ }
+
+ @Path("receive/subscriptionOrdering/{subscriptionName}")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String
receiveFromSubscriptionOrdered(@PathParam("subscriptionName") String
subscriptionName) throws Exception {
+
+ return consumeEndpoint(subscriptionName,
+
"?messageOrderingEnabled=true&pubsubEndpoint=us-east1-pubsub.googleapis.com:443");
Review Comment:
I chose `us-east1-pubsub` to stay consistent with camel integration test -
see
https://github.com/apache/camel/blob/main/components/camel-google/camel-google-pubsub/src/test/java/org/apache/camel/component/google/pubsub/integration/MessageOrderingIT.java#L46
The condition for pubsub ordering feature is, that all messages have to be
published in the same region to ensure ordering. I don't see a problem using
global or different endpoint in the test. @aldettinger Which one do you
suggest?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]