You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/09/02 05:36:22 UTC

[camel-k] branch master updated: Create amqpConsume.java (#1678)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/master by this push:
     new 7085985  Create amqpConsume.java (#1678)
7085985 is described below

commit 708598540d2389b790114bebc5dd73cdbcb8872c
Author: Robert Baumgartner <rb...@redhat.com>
AuthorDate: Wed Sep 2 07:36:13 2020 +0200

    Create amqpConsume.java (#1678)
    
    add AMQP Consumer for the  amqp.groovy and amqp.js examples.
---
 examples/amqpConsume.java | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/examples/amqpConsume.java b/examples/amqpConsume.java
new file mode 100644
index 0000000..a2323f9
--- /dev/null
+++ b/examples/amqpConsume.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// To run this integrations use:
+//
+//     kamel run -e BROKER_URL=event-bus-amqp-0-svc.messaging.svc.cluster.local -d camel-amqp examples/amqpConsumer.java
+//
+import org.apache.camel.BindToRegistry;
+
+public class amqpConsume extends org.apache.camel.builder.RouteBuilder {
+
+    @BindToRegistry
+    public javax.jms.ConnectionFactory connectionFactory() {
+        return new org.apache.qpid.jms.JmsConnectionFactory("amqp://" + java.lang.System.getenv("BROKER_URL"));
+    }
+
+    @Override
+    public void configure() throws Exception {
+
+        from("amqp:topic:example?exchangePattern=InOnly")
+            .to("log:info");
+
+    }
+}