You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/12/23 14:08:05 UTC

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #2093: Hazelcast native support fixes #1647

ppalaga commented on a change in pull request #2093:
URL: https://github.com/apache/camel-quarkus/pull/2093#discussion_r547972892



##########
File path: integration-tests/hazelcast/src/main/java/org/apache/camel/quarkus/component/hazelcast/it/HazelcastRoutes.java
##########
@@ -0,0 +1,189 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.hazelcast.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.ws.rs.Produces;
+
+import com.hazelcast.core.HazelcastInstance;
+import io.quarkus.arc.Unremovable;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.hazelcast.HazelcastConstants;
+import org.apache.camel.component.hazelcast.HazelcastDefaultComponent;
+import org.apache.camel.component.hazelcast.atomicnumber.HazelcastAtomicnumberComponent;
+import org.apache.camel.component.hazelcast.instance.HazelcastInstanceComponent;
+import org.apache.camel.component.hazelcast.list.HazelcastListComponent;
+import org.apache.camel.component.hazelcast.map.HazelcastMapComponent;
+import org.apache.camel.component.hazelcast.multimap.HazelcastMultimapComponent;
+import org.apache.camel.component.hazelcast.replicatedmap.HazelcastReplicatedmapComponent;
+import org.apache.camel.component.hazelcast.set.HazelcastSetComponent;
+import org.apache.camel.component.hazelcast.topic.HazelcastTopicComponent;
+
+@ApplicationScoped
+public class HazelcastRoutes extends RouteBuilder {
+    public static final String MOCK_LIST_ADDED = "mock:list-added";
+    public static final String MOCK_LIST_DELETED = "mock:list-removed";
+    public static final String MOCK_SET_ADDED = "mock:set-added";
+    public static final String MOCK_SET_DELETED = "mock:set-removed";
+    public static final String MOCK_MAP_ADDED = "mock:map-added";
+    public static final String MOCK_MAP_DELETED = "mock:map-removed";
+    public static final String MOCK_MAP_UPDATED = "mock:map-updated";
+    public static final String MOCK_MAP_EVICTED = "mock:map-evicted";
+    public static final String MOCK_MULTIMAP_ADDED = "mock:multimap-added";
+    public static final String MOCK_MULTIMAP_DELETED = "mock:multimap-removed";
+    public static final String MOCK_REPLICATED_ADDED = "mock:replicatedmap-added";
+    public static final String MOCK_REPLICATED_DELETED = "mock:replicatedmap-removed";
+    public static final String MOCK_TOPIC_RECEIVED = "mock:topic-received";
+
+    @Inject
+    HazelcastInstance hazelcastInstance;
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-instance")
+    HazelcastDefaultComponent hazelcastInstance() {
+        final HazelcastInstanceComponent hazelcastComponent = new HazelcastInstanceComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-atomicvalue")
+    HazelcastDefaultComponent hazelcastAtomicnumber() {
+        final HazelcastAtomicnumberComponent hazelcastComponent = new HazelcastAtomicnumberComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-list")
+    HazelcastDefaultComponent hazelcastList() {
+        final HazelcastListComponent hazelcastComponent = new HazelcastListComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-map")
+    HazelcastDefaultComponent hazelcastMap() {
+        final HazelcastMapComponent hazelcastComponent = new HazelcastMapComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-multimap")
+    HazelcastDefaultComponent hazelcastMultimap() {
+        final HazelcastMultimapComponent hazelcastComponent = new HazelcastMultimapComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-replicatedmap")
+    HazelcastDefaultComponent hazelcastReplicatedmap() {
+        final HazelcastReplicatedmapComponent hazelcastComponent = new HazelcastReplicatedmapComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-set")
+    HazelcastDefaultComponent hazelcastSet() {
+        final HazelcastSetComponent hazelcastComponent = new HazelcastSetComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    @Produces
+    @ApplicationScoped
+    @Unremovable
+    @Named("hazelcast-topic")
+    HazelcastDefaultComponent hazelcastTopic() {
+        final HazelcastTopicComponent hazelcastComponent = new HazelcastTopicComponent();
+        return getHazelcastComponent(hazelcastComponent);
+    }
+
+    private HazelcastDefaultComponent getHazelcastComponent(HazelcastDefaultComponent hazelcastComponent) {

Review comment:
       `configureHazelcastComponent` would perhaps better describe what this method does. 

##########
File path: extensions/hazelcast/runtime/pom.xml
##########
@@ -55,6 +63,20 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-hazelcast</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.hazelcast</groupId>
+            <artifactId>quarkus-hazelcast-client</artifactId>
+        </dependency>
+        <!-- fix version -->

Review comment:
       Is this comment needed?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org