Skip to content

Commit

Permalink
[#2029] Change Command Router default cache name.
Browse files Browse the repository at this point in the history
Signed-off-by: Carsten Lohmann <[email protected]>
  • Loading branch information
calohmn committed Dec 4, 2020
1 parent 6d3d2a8 commit 0274d88
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

public final class CommandRouterConstants extends RequestResponseApiConstants {

/**
* The default name of the (remote) cache in the data grid that is used for
* storing command router information.
*/
public static final String DEFAULT_CACHE_NAME = "command-router";

/**
* The name of the Command Router API endpoint.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.eclipse.hono.service.deviceconnection.DeviceConnectionService;
import org.eclipse.hono.service.metric.MetricsTags;
import org.eclipse.hono.util.CommandConstants;
import org.eclipse.hono.util.CommandRouterConstants;
import org.eclipse.hono.util.Constants;
import org.eclipse.hono.util.RegistrationConstants;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down Expand Up @@ -241,7 +242,9 @@ public CacheBasedDeviceConnectionInfo deviceConnectionInfo(final BasicCache<Stri
@Bean
@ConfigurationProperties(prefix = "hono.command-router.cache.common")
public CommonCacheConfig deviceConnectionInfoCommonCacheConfig() {
return new CommonCacheConfig();
final CommonCacheConfig commonCacheConfig = new CommonCacheConfig();
commonCacheConfig.setCacheName(CommandRouterConstants.DEFAULT_CACHE_NAME);
return commonCacheConfig;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/resources/commandrouter/cache-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
SPDX-License-Identifier: EPL-2.0
-->
<infinispan>
<cache-container default-cache="device-connection">
<local-cache name="device-connection" simple-cache="true">
<cache-container default-cache="command-router">
<local-cache name="command-router" simple-cache="true">
<memory>
<object size="100" strategy="REMOVE" />
</memory>
Expand Down

0 comments on commit 0274d88

Please sign in to comment.