Skip to content

Commit

Permalink
Merge pull request #26 from zeebe-io/deps-hazelcast-0.9.0
Browse files Browse the repository at this point in the history
chore(deps): dump zeebe-hazelcast-connector to 0.9.0
  • Loading branch information
saig0 authored May 22, 2020
2 parents bf3b63a + 41e0d82 commit c0bf1bb
Show file tree
Hide file tree
Showing 34 changed files with 76 additions and 58 deletions.
2 changes: 1 addition & 1 deletion app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.1.0</version>
<version>2.3.0</version>
<configuration>
<to>
<image>docker.io/camunda/zeeqs</image>
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/kotlin/io/zeebe/zeeqs/HazelcastProperties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.ConstructorBinding

@ConstructorBinding
@ConfigurationProperties("io.zeebe.hazelcast")
@ConfigurationProperties("zeebe.hazelcast")
data class HazelcastProperties(
val connection: String = "localhost:5701"
val connection: String = "localhost:5701",
val connectionTimeout: String = "PT30S"
)
4 changes: 3 additions & 1 deletion app/src/main/kotlin/io/zeebe/zeeqs/ZeeqlApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.runApplication
import org.springframework.cache.annotation.EnableCaching
import java.time.Duration
import javax.annotation.PostConstruct

@SpringBootApplication
Expand All @@ -20,9 +21,10 @@ class ZeeqlApplication(
@PostConstruct
fun init() {
val connection = hazelcastProperties.connection
val connectionTimeout = Duration.parse(hazelcastProperties.connectionTimeout)

logger.info("connect to Hazelcast: '$connection'")
hazelcastImporter.start(connection)
hazelcastImporter.start(connection, connectionTimeout)
}
}

Expand Down
2 changes: 1 addition & 1 deletion data/src/test/kotlin/io/zeebe/zeeqs/WorkflowServiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WorkflowServiceTest(
val bpmn = Bpmn.createExecutableProcess("wf")
.startEvent("s").name("start")
.serviceTask("t").name("task")
.zeebeTaskType("test")
.zeebeJobType("test")
.endEvent("e").name("")
.done()

Expand Down
6 changes: 6 additions & 0 deletions docker/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
zeebe:
broker:
exporters:
hazelcast:
className: io.zeebe.hazelcast.exporter.HazelcastExporter
jarPath: exporters/zeebe-hazelcast-exporter.jar
9 changes: 5 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ networks:
services:
zeebe:
container_name: zeebe_broker
image: camunda/zeebe:0.22.2
image: camunda/zeebe:0.23.1
environment:
- ZEEBE_LOG_LEVEL=debug
ports:
Expand All @@ -16,14 +16,15 @@ services:
- "5701:5701"
volumes:
- ../target/exporter/zeebe-hazelcast-exporter.jar:/usr/local/zeebe/exporters/zeebe-hazelcast-exporter.jar
- ./zeebe.cfg.toml:/usr/local/zeebe/conf/zeebe.cfg.toml
- ./application.yaml:/usr/local/zeebe/config/application.yaml
networks:
- zeebe_network
monitor:

zeeqs:
container_name: zeeqs
image: camunda/zeeqs:latest
environment:
- io.zeebe.hazelcast.connection=zeebe:5701
- zeebe.hazelcast.connection=zeebe:5701
ports:
- "9000:9000"
depends_on:
Expand Down
4 changes: 0 additions & 4 deletions docker/zeebe.cfg.toml

This file was deleted.

10 changes: 5 additions & 5 deletions graphql-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
</dependency>

<dependency>
<groupId>com.graphql-java</groupId>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java-tools</artifactId>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphiql-spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphiql-spring-boot-starter</artifactId>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-java-tools</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.graphql.resolvers.connection

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.Incident
import org.springframework.stereotype.Component

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.graphql.resolvers.connection

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.Job
import org.springframework.stereotype.Component

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.graphql.resolvers.connection

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.Message
import org.springframework.stereotype.Component

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.graphql.resolvers.connection

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.Workflow
import org.springframework.stereotype.Component

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.graphql.resolvers.connection

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.WorkflowInstance
import org.springframework.stereotype.Component

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.graphql.resolvers.connection

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.MessageSubscription
import io.zeebe.zeeqs.data.entity.Timer
import io.zeebe.zeeqs.data.entity.Workflow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLQueryResolver
import graphql.kickstart.tools.GraphQLQueryResolver
import io.zeebe.zeeqs.data.entity.Incident
import io.zeebe.zeeqs.data.entity.IncidentState
import io.zeebe.zeeqs.data.repository.IncidentRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLQueryResolver
import graphql.kickstart.tools.GraphQLQueryResolver
import io.zeebe.zeeqs.data.entity.Job
import io.zeebe.zeeqs.data.entity.JobState
import io.zeebe.zeeqs.data.repository.JobRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLQueryResolver
import graphql.kickstart.tools.GraphQLQueryResolver
import io.zeebe.zeeqs.data.entity.Message
import io.zeebe.zeeqs.data.repository.MessageRepository
import io.zeebe.zeeqs.graphql.resolvers.connection.MessageConnection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLQueryResolver
import graphql.kickstart.tools.GraphQLQueryResolver
import io.zeebe.zeeqs.data.entity.Variable
import io.zeebe.zeeqs.data.repository.VariableRepository
import org.springframework.stereotype.Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLQueryResolver
import graphql.kickstart.tools.GraphQLQueryResolver
import io.zeebe.zeeqs.data.entity.WorkflowInstance
import io.zeebe.zeeqs.data.entity.WorkflowInstanceState
import io.zeebe.zeeqs.data.repository.WorkflowInstanceRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLQueryResolver
import graphql.kickstart.tools.GraphQLQueryResolver
import io.zeebe.zeeqs.data.entity.Workflow
import io.zeebe.zeeqs.data.repository.WorkflowRepository
import io.zeebe.zeeqs.graphql.resolvers.connection.WorkflowConnection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.*
import io.zeebe.zeeqs.data.repository.*
import io.zeebe.zeeqs.data.service.WorkflowService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.ElementInstanceStateTransition
import io.zeebe.zeeqs.graphql.resolvers.type.ResolverExtension
import org.springframework.stereotype.Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.ElementInstance
import io.zeebe.zeeqs.data.entity.Incident
import io.zeebe.zeeqs.data.entity.Job
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.ElementInstance
import io.zeebe.zeeqs.data.entity.Incident
import io.zeebe.zeeqs.data.entity.Job
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.Message
import io.zeebe.zeeqs.data.entity.MessageCorrelation
import io.zeebe.zeeqs.data.entity.MessageSubscription
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.Message
import io.zeebe.zeeqs.data.entity.MessageCorrelation
import io.zeebe.zeeqs.data.entity.MessageSubscription
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.*
import io.zeebe.zeeqs.data.repository.ElementInstanceRepository
import io.zeebe.zeeqs.data.repository.MessageCorrelationRepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.graphql.resolvers.type

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.ElementInstance
import io.zeebe.zeeqs.data.entity.Timer
import io.zeebe.zeeqs.data.entity.Workflow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.ElementInstance
import io.zeebe.zeeqs.data.entity.Variable
import io.zeebe.zeeqs.data.entity.VariableUpdate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.VariableUpdate
import io.zeebe.zeeqs.graphql.resolvers.type.ResolverExtension
import org.springframework.stereotype.Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.zeebe.zeeqs.data.resolvers

import com.coxautodev.graphql.tools.GraphQLResolver
import graphql.kickstart.tools.GraphQLResolver
import io.zeebe.zeeqs.data.entity.*
import io.zeebe.zeeqs.data.repository.*
import io.zeebe.zeeqs.graphql.resolvers.type.ResolverExtension.timestampToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import io.zeebe.hazelcast.connect.java.ZeebeHazelcast
import io.zeebe.zeeqs.data.entity.*
import io.zeebe.zeeqs.data.repository.*
import org.springframework.stereotype.Component
import java.time.Duration


@Component
class HazelcastImporter(
Expand All @@ -26,7 +28,7 @@ class HazelcastImporter(

var zeebeHazelcast: ZeebeHazelcast? = null

fun start(hazelcastConnection: String) {
fun start(hazelcastConnection: String, hazelcastConnectionTimeout: Duration) {

val hazelcastConfig = hazelcastConfigRepository.findById(hazelcastConnection)
.orElse(HazelcastConfig(
Expand All @@ -41,9 +43,9 @@ class HazelcastImporter(
val clientConfig = ClientConfig()
val networkConfig = clientConfig.networkConfig
networkConfig.addresses = listOf(hazelcastConnection)
// networkConfig.connectionAttemptPeriod = Duration.ofSeconds(10).toMillis().toInt()
// networkConfig.connectionAttemptLimit = 10
// networkConfig.connectionTimeout = Duration.ofSeconds(10).toMillis().toInt()

val connectionRetryConfig = clientConfig.connectionStrategyConfig.connectionRetryConfig
connectionRetryConfig.clusterConnectTimeoutMillis = hazelcastConnectionTimeout.toMillis()

val hazelcast = HazelcastClient.newHazelcastClient(clientConfig)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HazelcastImporterTest(
fun `should import workflow`() {
// given
val port = zeebe.getMappedPort(hazelcastPort)
importer.start("localhost:$port")
importer.start("localhost:$port", Duration.ofSeconds(10))

val client = ZeebeClient.newClientBuilder()
.brokerContactPoint(zeebe.getExternalAddress(ZeebePort.GATEWAY))
Expand All @@ -58,7 +58,7 @@ class HazelcastImporterTest(
.addWorkflowModel(
Bpmn.createExecutableProcess("wf")
.startEvent()
.serviceTask("task-1").zeebeTaskType("test")
.serviceTask("task-1").zeebeJobType("test")
.endEvent()
.done(),
"wf.bpmn")
Expand Down
Loading

0 comments on commit c0bf1bb

Please sign in to comment.