Feature horizontal scalability (#305)
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
committed by
Kai Zimmermann
parent
07cb62a3dd
commit
866bc72114
@@ -8,5 +8,4 @@ Example projects that show how _hawkBit_ can be used to create, run or access an
|
||||
- `hawkbit-example-core-feign-client` : Core resources for the client examples.
|
||||
- `hawkbit-example-ddi-feign-client` : Example _hawkBit_ DDI client based on the _hawkBit_ DDI API.
|
||||
- `hawkbit-example-mgmt-feign-client` : Example _hawkBit_ Management client based on the _hawkBit_ Management API
|
||||
- `hawkbit-example-mgmt-simulator` : Example client simulation for the _hawkBit_ Management API based on Spring Boot and the hawkbit-example-mgmt-feign-client.
|
||||
|
||||
- `hawkbit-example-mgmt-simulator` : Example client simulation for the _hawkBit_ Management API based on Spring Boot and the hawkbit-example-mgmt-feign-client.
|
||||
@@ -93,16 +93,6 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
|
||||
@@ -8,14 +8,10 @@ package org.eclipse.hawkbit.app;
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||
import org.eclipse.hawkbit.ui.push.DelayedEventBusPushStrategy;
|
||||
import org.eclipse.hawkbit.ui.push.UIEventProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
||||
import org.vaadin.spring.events.EventBus.SessionEventBus;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.vaadin.annotations.Push;
|
||||
import com.vaadin.annotations.Theme;
|
||||
import com.vaadin.annotations.Title;
|
||||
@@ -39,9 +35,15 @@ public class MyUI extends HawkbitUI {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
public MyUI(final ScheduledExecutorService executorService, final EventBus systemEventBus,
|
||||
final org.vaadin.spring.events.EventBus.SessionEventBus eventBus, final UIEventProvider provider) {
|
||||
super(new DelayedEventBusPushStrategy(executorService, eventBus, systemEventBus, provider));
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param pushStrategy
|
||||
* the push strategy
|
||||
* @param eventBus
|
||||
* the event bus
|
||||
*/
|
||||
public MyUI(final EventPushStrategy pushStrategy, final SessionEventBus eventBus) {
|
||||
super(pushStrategy, eventBus);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,11 +105,11 @@
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -12,9 +12,6 @@ import org.eclipse.hawkbit.simulator.AbstractSimulatedDevice;
|
||||
|
||||
/**
|
||||
* Event description which indicates the initialization of an update.
|
||||
*
|
||||
* @author Michael Hirsch
|
||||
*
|
||||
*/
|
||||
public class InitUpdate {
|
||||
|
||||
|
||||
@@ -13,10 +13,7 @@ import java.util.Collection;
|
||||
import org.eclipse.hawkbit.simulator.AbstractSimulatedDevice;
|
||||
|
||||
/**
|
||||
* Event description which indicates an poll time update.
|
||||
*
|
||||
* @author Michael Hirsch
|
||||
*
|
||||
* Event description which indicates a poll time update.
|
||||
*/
|
||||
public class NextPollCounterUpdate {
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.eclipse.hawkbit.simulator.DeviceSimulatorRepository;
|
||||
import org.eclipse.hawkbit.simulator.SimulatedDeviceFactory;
|
||||
import org.eclipse.hawkbit.simulator.UpdateStatus.ResponseStatus;
|
||||
import org.eclipse.hawkbit.simulator.amqp.AmqpProperties;
|
||||
import org.eclipse.hawkbit.simulator.amqp.SpSenderService;
|
||||
import org.eclipse.hawkbit.simulator.event.InitUpdate;
|
||||
import org.eclipse.hawkbit.simulator.event.NextPollCounterUpdate;
|
||||
import org.eclipse.hawkbit.simulator.event.ProgressUpdate;
|
||||
@@ -58,9 +57,6 @@ import com.vaadin.ui.renderers.ProgressBarRenderer;
|
||||
@SuppressWarnings("squid:MaximumInheritanceDepth")
|
||||
public class SimulatorView extends VerticalLayout implements View {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final String HTML_SPAN = ";</span>";
|
||||
|
||||
private static final String NEXT_POLL_COUNTER_SEC_COL = "nextPollCounterSec";
|
||||
@@ -81,10 +77,9 @@ public class SimulatorView extends VerticalLayout implements View {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
private transient SpSenderService spSenderService;
|
||||
@Autowired
|
||||
private transient DeviceSimulatorRepository repository;
|
||||
|
||||
@Autowired
|
||||
private transient SimulatedDeviceFactory deviceFactory;
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ security.user.password=${BASIC_PASSWORD:admin}
|
||||
security.user.role=USER
|
||||
security.require-ssl=false
|
||||
security.enable-csrf=false
|
||||
security.basic.enabled=true
|
||||
security.basic.realm=DeviceSimulator
|
||||
security.basic.path= /**
|
||||
security.basic.authorize-mode=ROLE
|
||||
|
||||
@@ -12,16 +12,7 @@
|
||||
<configuration>
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml" />
|
||||
|
||||
<logger name="org.eclipse.hawkbit.eventbus.DeadEventListener" level="WARN" />
|
||||
<Logger name="org.springframework.boot.actuate.audit.listener.AuditListener" level="WARN" />
|
||||
|
||||
<Logger name="org.hibernate.validator.internal.util.Version" level="WARN" />
|
||||
|
||||
<Logger name="org.apache.coyote.http11.Http11NioProtocol" level="WARN" />
|
||||
<Logger name="org.apache.tomcat.util.net.NioSelectorPool" level="WARN" />
|
||||
<Logger name="org.apache.catalina.startup.DigesterFactory" level="ERROR" />
|
||||
|
||||
<Root level="INFO">
|
||||
<Root level="ERROR">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</Root>
|
||||
|
||||
|
||||
@@ -33,3 +33,45 @@ The Management API can be accessed via http://localhost:8080/rest/v1
|
||||
- **manifest-simple.yml** for a standalone hawkBit installation with embedded H2.
|
||||
- **manifest.yml** for a standalone hawkBit installation with embedded H2 and RabbitMQ service binding for DMF integration (note: this manifest is used for the sandbox above).
|
||||
- Run ```cf push``` against you cloud foundry environment.
|
||||
|
||||
# Enable Clustering (experimental)
|
||||
|
||||
Clustering in hawkBit is based on _Spring Cloud Bus_. It is not enabled in the example app by default.
|
||||
|
||||
Add to your `application.properties` :
|
||||
|
||||
```
|
||||
spring.cloud.bus.enabled=true
|
||||
```
|
||||
|
||||
Add to your `pom.xml` :
|
||||
|
||||
```
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Optional as well is the addition of [Protostuff](https://github.com/protostuff/protostuff) based message payload serialization for improved performance.
|
||||
|
||||
|
||||
Add to your `application.properties` :
|
||||
|
||||
```
|
||||
spring.cloud.stream.bindings.springCloudBusInput.content-type=application/binary+protostuff
|
||||
spring.cloud.stream.bindings.springCloudBusOutput.content-type=application/binary+protostuff
|
||||
```
|
||||
|
||||
Add to your `pom.xml` :
|
||||
|
||||
```
|
||||
<dependency>
|
||||
<groupId>io.protostuff</groupId>
|
||||
<artifactId>protostuff-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.protostuff</groupId>
|
||||
<artifactId>protostuff-runtime</artifactId>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@@ -97,7 +97,6 @@
|
||||
<artifactId>hawkbit-repository-jpa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -8,14 +8,10 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.app;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||
import org.eclipse.hawkbit.ui.push.DelayedEventBusPushStrategy;
|
||||
import org.eclipse.hawkbit.ui.push.UIEventProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
|
||||
import org.vaadin.spring.events.EventBus.SessionEventBus;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.vaadin.annotations.Push;
|
||||
import com.vaadin.shared.communication.PushMode;
|
||||
import com.vaadin.shared.ui.ui.Transport;
|
||||
@@ -35,12 +31,18 @@ import com.vaadin.spring.annotation.SpringUI;
|
||||
// Vaadin.
|
||||
@SuppressWarnings({ "squid:MaximumInheritanceDepth" })
|
||||
public class MyUI extends HawkbitUI {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
public MyUI(final ScheduledExecutorService scheduledExecutorService, final EventBus systemEventBus,
|
||||
final org.vaadin.spring.events.EventBus.SessionEventBus eventBus, final UIEventProvider provider) {
|
||||
super(new DelayedEventBusPushStrategy(scheduledExecutorService, eventBus, systemEventBus, provider));
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param pushStrategy
|
||||
* the push strategy
|
||||
* @param eventBus
|
||||
* the event bus
|
||||
*/
|
||||
public MyUI(final EventPushStrategy pushStrategy, final SessionEventBus eventBus) {
|
||||
super(pushStrategy, eventBus);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -46,7 +46,7 @@
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-slf4j</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -36,12 +36,11 @@
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
<!-- need to overwrite for the interface inheritance feature of feign-core -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<artifactId>hawkbit-examples-parent</artifactId>
|
||||
<name>hawkBit-example :: Parent</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>repo.eclipse.org</id>
|
||||
@@ -42,22 +42,4 @@
|
||||
<module>hawkbit-example-mgmt-feign-client</module>
|
||||
<module>hawkbit-example-mgmt-simulator</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Brixton.SR5</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-jackson</artifactId>
|
||||
<version>8.16.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user