Skip to content

Commit

Permalink
enable camunda document store
Browse files Browse the repository at this point in the history
  • Loading branch information
chillleader committed Dec 9, 2024
1 parent 3f7d8d3 commit 82289a7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.camunda.connector.runtime.app;

import io.camunda.document.store.CamundaDocumentStore;
import io.camunda.document.store.InMemoryDocumentStore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;

@Configuration
@Profile("in-memory-document-store")
public class InMemoryDocumentStoreConfiguration {

@Bean
@Primary
public CamundaDocumentStore inMemoryDocumentStore() {
return InMemoryDocumentStore.INSTANCE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public class LocalConnectorRuntime {
public static void main(String[] args) {
// Comment this line if you are using the docker-compose.yml file instead of the
// docker-compose-core.yml file
System.setProperty(AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME, "docker-core");
System.setProperty(
AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME, "docker-core,in-memory-document-store");
SpringApplication.run(ConnectorRuntimeApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
import io.camunda.connector.runtime.outbound.lifecycle.OutboundConnectorManager;
import io.camunda.document.factory.DocumentFactory;
import io.camunda.document.factory.DocumentFactoryImpl;
import io.camunda.document.store.InMemoryDocumentStore;
import io.camunda.document.store.CamundaDocumentStore;
import io.camunda.document.store.CamundaDocumentStoreImpl;
import io.camunda.zeebe.client.ZeebeClient;
import io.camunda.zeebe.spring.client.jobhandling.CommandExceptionHandlingStrategy;
import io.camunda.zeebe.spring.client.jobhandling.JobWorkerManager;
import io.camunda.zeebe.spring.client.metrics.MetricsRecorder;
Expand All @@ -44,8 +46,13 @@ public OutboundConnectorFactory outboundConnectorFactory() {
}

@Bean
public DocumentFactory documentFactory() {
return new DocumentFactoryImpl(InMemoryDocumentStore.INSTANCE);
public CamundaDocumentStore documentStore(ZeebeClient zeebeClient) {
return new CamundaDocumentStoreImpl(zeebeClient);
}

@Bean
public DocumentFactory documentFactory(CamundaDocumentStore documentStore) {
return new DocumentFactoryImpl(documentStore);
}

@Bean
Expand Down

0 comments on commit 82289a7

Please sign in to comment.