I’m trying to run an outbound connector in docker using self-managed version with necessity of a credential object to be configured at the start of application
Dockerfile in the application goes like this
FROM camunda/connectors:0.21.3
COPY target/example-0.0.1-SNAPSHOT.jar /opt/app/
ENTRYPOINT ["/start.sh"]
Compose file is
services:
test-connector:
image: test-connector:latest
container_name: testConnector
environment:
- ZEEBE_CLIENT_BROKER_GATEWAY-ADDRESS=zeebe:26500
- ZEEBE_CLIENT_SECURITY_PLAINTEXT=true
- CAMUNDA_CONNECTOR_POLLING_ENABLED=false
- CAMUNDA_CONNECTOR_WEBHOOK_ENABLED=false
- SPRING_MAIN_WEB-APPLICATION-TYPE=none
- OPERATE_CLIENT_ENABLED=false
networks:
- camunda-platform-828_camunda-platform
volumes:
- type: bind
source: xxxxx
target: xxxxx
networks:
camunda-platform-828_camunda-platform:
external: true
During runtime it is unable to create the credential object in side the @OutboundConnector class
so i have created a custom runtime environment with the help of this docs
The custom connector code is
public class Main {
public static Object object;// credential object
static {
//code to configure credetial object using the volume mount file
}
public static void main(String[] args) {
var zeebeClient = ZeebeClient.newClientBuilder().build();
zeebeClient.newWorker()
.jobType("io.camunda:template:1")
.handler(new ConnectorJobHandler(new MyConnectorFunction()))
.name("MESSAGE")
.fetchVariables("authentication", "message")
.open();
}
}
Im trying to acces the credential object in the @OutboundConnector class like this
@OutboundConnector(
name = "MYCONNECTOR",
inputVariables = {"myProperty", "authentication"},
type = "io.camunda:template:1"
)
public class MyConnectorFunction implements OutboundConnectorFunction {
private static final Logger LOGGER = LoggerFactory.getLogger(MyConnectorFunction.class);
@Override
public Object execute(OutboundConnectorContext context) throws Exception {
var connectorRequest = context.getVariablesAsType(MyConnectorRequest.class);
String message = executeConnector(connectorRequest,Main.Object);//the static credential object from main class
The connector is running but when I try to access the object after invoking the connector it is giving as null and not moving further because it’s needed
I have tried the same app with the Spring boot connector Runtime locally its working fine but, I want to build the runtime in docker
Is there anything i’m missing or any alternate approach is there
@igpetrov, @jwulf , @Niall , @nathan.loding please help with this