forked from eclipse-ditto/ditto
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eclipse-ditto#99 from bsinno/feature/error_loggin_…
…main_methods
- Loading branch information
Showing
33 changed files
with
1,826 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 0 additions & 118 deletions
118
...s/amqp-bridge/starter/src/main/java/org/eclipse/ditto/services/amqpbridge/AmqpBridge.java
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
...bridge/starter/src/main/java/org/eclipse/ditto/services/amqpbridge/AmqpBridgeService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (c) 2017 Bosch Software Innovations GmbH. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/org/documents/epl-2.0/index.php | ||
* | ||
* Contributors: | ||
* Bosch Software Innovations GmbH - initial contribution | ||
*/ | ||
package org.eclipse.ditto.services.amqpbridge; | ||
|
||
import org.eclipse.ditto.services.amqpbridge.actors.AmqpBridgeRootActor; | ||
import org.eclipse.ditto.services.amqpbridge.util.ConfigKeys; | ||
import org.eclipse.ditto.services.base.BaseConfigKey; | ||
import org.eclipse.ditto.services.base.BaseConfigKeys; | ||
import org.eclipse.ditto.services.base.DittoService; | ||
import org.eclipse.ditto.utils.jsr305.annotations.AllParametersAndReturnValuesAreNonnullByDefault; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.typesafe.config.Config; | ||
|
||
import akka.actor.ActorRef; | ||
import akka.actor.Props; | ||
import akka.stream.ActorMaterializer; | ||
|
||
/** | ||
* Entry point of the AMQP Bridge. | ||
* <ul> | ||
* <li>Reads configuration, enhances it with cloud environment settings.</li> | ||
* <li>Sets up Akka actor system.</li> | ||
* </ul> | ||
*/ | ||
@AllParametersAndReturnValuesAreNonnullByDefault | ||
public final class AmqpBridgeService extends DittoService { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(AmqpBridgeService.class); | ||
|
||
/** | ||
* Name for the Akka Actor System of the AMQP Bridge. | ||
*/ | ||
private static final String SERVICE_NAME = "amqp-bridge"; | ||
|
||
private AmqpBridgeService() { | ||
super(LOGGER, SERVICE_NAME, AmqpBridgeRootActor.ACTOR_NAME, BaseConfigKeys.getBuilder() | ||
.put(BaseConfigKey.Cluster.MAJORITY_CHECK_ENABLED, ConfigKeys.Cluster.MAJORITY_CHECK_ENABLED) | ||
.put(BaseConfigKey.Cluster.MAJORITY_CHECK_DELAY, ConfigKeys.Cluster.MAJORITY_CHECK_DELAY) | ||
.build()); | ||
} | ||
|
||
/** | ||
* Starts the AMQP 1.0 Bridge. | ||
* | ||
* @param args command line arguments. | ||
*/ | ||
public static void main(final String[] args) { | ||
final AmqpBridgeService amqpBridgeService = new AmqpBridgeService(); | ||
amqpBridgeService.start(); | ||
} | ||
|
||
@Override | ||
protected Props getMainRootActorProps(final Config config, final ActorRef pubSubMediator, | ||
final ActorMaterializer materializer) { | ||
|
||
return AmqpBridgeRootActor.props(config, pubSubMediator, materializer); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2017 Bosch Software Innovations GmbH. | ||
~ | ||
~ All rights reserved. This program and the accompanying materials | ||
~ are made available under the terms of the Eclipse Public License v2.0 | ||
~ which accompanies this distribution, and is available at | ||
~ https://www.eclipse.org/org/documents/epl-2.0/index.php | ||
~ | ||
~ Contributors: | ||
~ Bosch Software Innovations GmbH - initial contribution | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.ditto</groupId> | ||
<artifactId>ditto-services</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
|
||
<artifactId>ditto-services-base</artifactId> | ||
<name>Eclipse Ditto :: Services :: Base</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.ditto</groupId> | ||
<artifactId>ditto-model-base</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.ditto</groupId> | ||
<artifactId>ditto-services-utils-devops</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.ditto</groupId> | ||
<artifactId>ditto-services-utils-config</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.typesafe.akka</groupId> | ||
<artifactId>akka-actor_${scala.version}</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.github.scullxbones</groupId> | ||
<artifactId>akka-persistence-mongo-common_${scala.version}</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.kamon</groupId> | ||
<artifactId>kamon-core_${scala.version}</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.dropwizard.metrics</groupId> | ||
<artifactId>metrics-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.jjagged</groupId> | ||
<artifactId>metrics-statsd</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
57 changes: 57 additions & 0 deletions
57
services/base/src/main/java/org/eclipse/ditto/services/base/BaseConfigKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (c) 2017 Bosch Software Innovations GmbH. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/org/documents/epl-2.0/index.php | ||
* | ||
* Contributors: | ||
* Bosch Software Innovations GmbH - initial contribution | ||
*/ | ||
package org.eclipse.ditto.services.base; | ||
|
||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* This marker interface provides enumerations of commonly known configuration keys. <em>This interface should not | ||
* be implemented by anyone.</em> | ||
*/ | ||
@Immutable | ||
public interface BaseConfigKey { | ||
|
||
/** | ||
* Enumeration of keys for cluster configuration settings. | ||
*/ | ||
enum Cluster implements BaseConfigKey { | ||
|
||
/** | ||
* Key of the configuration setting which indicates whether the majority check is enabled. | ||
*/ | ||
MAJORITY_CHECK_ENABLED, | ||
|
||
/** | ||
* Key of the majority check delay configuration setting. | ||
*/ | ||
MAJORITY_CHECK_DELAY; | ||
|
||
} | ||
|
||
/** | ||
* Enumeration of keys for StatsD configuration settings. | ||
*/ | ||
enum StatsD implements BaseConfigKey { | ||
|
||
/** | ||
* Key of the StatsD hostname configuration setting. | ||
*/ | ||
HOSTNAME, | ||
|
||
/** | ||
* Key of the StatsD port configuration setting. | ||
*/ | ||
PORT; | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.