Skip to content

Commit

Permalink
Merge pull request eclipse-ditto#99 from bsinno/feature/error_loggin_…
Browse files Browse the repository at this point in the history
…main_methods
  • Loading branch information
jokraehe committed Jan 16, 2018
2 parents 666dcc0 + 75e4621 commit 841f541
Show file tree
Hide file tree
Showing 33 changed files with 1,826 additions and 791 deletions.
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,11 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.ditto</groupId>
<artifactId>ditto-services-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.ditto</groupId>
<artifactId>ditto-services-models-amqp-bridge</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion services/amqp-bridge/starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
</properties>

<dependencies>
<dependency>
<groupId>org.eclipse.ditto</groupId>
<artifactId>ditto-services-base</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ditto-services-amqpbridge-messaging</artifactId>
Expand Down Expand Up @@ -186,7 +190,7 @@
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>org.eclipse.ditto.services.amqpbridge.AmqpBridge</Main-Class>
<Main-Class>org.eclipse.ditto.services.amqpbridge.AmqpBridgeService</Main-Class>
</manifestEntries>
</transformer>
</transformers>
Expand Down

This file was deleted.

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);
}

}
70 changes: 70 additions & 0 deletions services/base/pom.xml
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>
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;

}

}
Loading

0 comments on commit 841f541

Please sign in to comment.