You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/06/23 02:18:39 UTC

[camel-k] branch main updated: migrate and improve amqp example

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 0dd4c6e0d migrate and improve amqp example
0dd4c6e0d is described below

commit 0dd4c6e0d36d397a05640209a06fa1d39aa22aa4
Author: Kuthumi Pepple <ku...@gmail.com>
AuthorDate: Tue Jun 21 18:38:06 2022 +0100

    migrate and improve amqp example
---
 examples/amqp/AmqpConnectionBeanConsumer.java | 30 ---------------------
 examples/amqp/AmqpConnectionBeanProducer.java | 32 ----------------------
 examples/amqp/README.md                       |  5 ----
 examples/amqp/amqp.groovy                     | 39 ---------------------------
 examples/amqp/amqp.js                         | 31 ---------------------
 examples/amqp/amqp.properties                 |  4 ---
 examples/amqp/artemis/README.md               | 26 ------------------
 examples/amqp/artemis/artemis-amqp.yaml       | 31 ---------------------
 examples/amqp/artemis/artemis-service.yaml    | 35 ------------------------
 9 files changed, 233 deletions(-)

diff --git a/examples/amqp/AmqpConnectionBeanConsumer.java b/examples/amqp/AmqpConnectionBeanConsumer.java
deleted file mode 100644
index e4b876da7..000000000
--- a/examples/amqp/AmqpConnectionBeanConsumer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-// You can bundle your credentials as a secret properties file:
-//
-// kubectl create secret generic my-amqp --from-file=amqp.properties
-// 
-// kamel run AmqpConnectionBeanConsumer.java --dev --config secret:my-amqp
-
-public class AmqpConnectionBeanConsumer extends org.apache.camel.builder.RouteBuilder {
-    @Override
-    public void configure() throws Exception {
-        from("amqp:queue:example?exchangePattern=InOnly")
-            .to("log:info");
-    }
-}
diff --git a/examples/amqp/AmqpConnectionBeanProducer.java b/examples/amqp/AmqpConnectionBeanProducer.java
deleted file mode 100644
index c76642658..000000000
--- a/examples/amqp/AmqpConnectionBeanProducer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.
- */
-
-// You can bundle your credentials as a secret properties file:
-//
-// kubectl create secret generic my-amqp --from-file=amqp.properties
-// 
-// kamel run AmqpConnectionBeanProducer.java --dev --config secret:my-amqp
-
-public class AmqpConnectionBeanProducer extends org.apache.camel.builder.RouteBuilder {
-    @Override
-    public void configure() throws Exception {
-        from("timer:foo?period=1000")
-            .setBody()
-                .simple("Hello Camel K")
-            .to("amqp:queue:example?exchangePattern=InOnly")
-    }
-}
diff --git a/examples/amqp/README.md b/examples/amqp/README.md
deleted file mode 100644
index a23983d83..000000000
--- a/examples/amqp/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# AMQP Camel K examples
-
-Find useful examples about how to use AMQP in a Camel K integration.
-
-You may find useful instructions [how to install a JMS/AMQP Broker on Kubernetes](./artemis/) for demo purposes.
\ No newline at end of file
diff --git a/examples/amqp/amqp.groovy b/examples/amqp/amqp.groovy
deleted file mode 100644
index 73b632054..000000000
--- a/examples/amqp/amqp.groovy
+++ /dev/null
@@ -1,39 +0,0 @@
-// camel-k: language=groovy
-/*
- * 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/amqp.groovy
-//
-
-camel {
-    components {
-        amqp {
-            connectionFactory = new org.apache.qpid.jms.JmsConnectionFactory(
-                new URI('amqp://' + System.getenv('BROKER_URL'))
-            )
-        }
-    }
-}
-
-from('timer:js?period=1000')
-    .routeId('js')
-    .setBody()
-        .simple('Hello Camel K')
-    .to('amqp:topic:example?exchangePattern=InOnly')
diff --git a/examples/amqp/amqp.js b/examples/amqp/amqp.js
deleted file mode 100644
index 78db23a0f..000000000
--- a/examples/amqp/amqp.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// camel-k: language=js
-// 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/amqp.js
-//
-components.get('amqp')
-    .setConnectionFactory(
-        new org.apache.qpid.jms.JmsConnectionFactory('amqp://' + java.lang.System.getenv('BROKER_URL'))
-    );
-
-from('timer:js?period=1000')
-    .routeId('js')
-    .setBody()
-        .simple('Hello Camel K')
-    .to('amqp:topic:example?exchangePattern=InOnly')
diff --git a/examples/amqp/amqp.properties b/examples/amqp/amqp.properties
deleted file mode 100644
index 851b01477..000000000
--- a/examples/amqp/amqp.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-quarkus.qpid-jms.url=amqp://my-amqp-service:5672
-# Optional
-# quarkus.qpid-jms.username=xxxx
-# quarkus.qpid-jms.password=xxxx
diff --git a/examples/amqp/artemis/README.md b/examples/amqp/artemis/README.md
deleted file mode 100644
index 15db404f3..000000000
--- a/examples/amqp/artemis/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# How to deploy a simple JMS/AMQP Broker to Kubernetes cluster
-
-This is a very simple example to show how to create a JMS/AMQP broker. **Note**, this is not ready for any production purpose.
-
-## Create a Kubernetes Deployment
-
-You can [install ActiveMQ Artemis on Kubernetes](https://artemiscloud.io/blog/using_operator/) thanks to ArtemisCloud.io. It would be enough to execute step 1, 2 and 3 of the linked blog post.
-
-## Create an AMQP broker instance
-
-Once the operator is up and running, you can proceed by creating a basic install of a broker accepting `amqp` protocol:
-
-```
-kubectl apply -f artemis-amqp.yaml
-```
-
-## Expose the Broker via service
-
-We need to make the broker accessible from the `Integration`. Let's do that via a `Service`:
-
-```
-kubectl apply -f artemis-service.yaml
-
-```
-
-We're now ready to use the `Broker`.
diff --git a/examples/amqp/artemis/artemis-amqp.yaml b/examples/amqp/artemis/artemis-amqp.yaml
deleted file mode 100644
index deb1ecdb8..000000000
--- a/examples/amqp/artemis/artemis-amqp.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# ---------------------------------------------------------------------------
-# 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.
-# ---------------------------------------------------------------------------
-
-apiVersion: broker.amq.io/v2alpha4
-kind: ActiveMQArtemis
-metadata:
-  name: my-amqp
-spec:
-  deploymentPlan:
-    size: 1
-    image: placeholder
-  acceptors:
-  - name: amqp
-    protocols: amqp,openwire
-    port: 5672
-    sslEnabled: false
-    
\ No newline at end of file
diff --git a/examples/amqp/artemis/artemis-service.yaml b/examples/amqp/artemis/artemis-service.yaml
deleted file mode 100644
index 33a84066c..000000000
--- a/examples/amqp/artemis/artemis-service.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-# ---------------------------------------------------------------------------
-# 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.
-# ---------------------------------------------------------------------------
-
-apiVersion: v1
-kind: Service
-metadata:
-  name: my-amqp-service
-  labels:
-    ActiveMQArtemis: my-amqp
-    application: my-amqp-app
-spec:
-  ports:
-    - port: 5672
-      name: amqp
-    - port: 8161
-      name: http
-  selector:
-    ActiveMQArtemis: my-amqp
-    application: my-amqp-app
-  type: NodePort
-  
\ No newline at end of file