# Camunda 8.5 access Spring Boot application.properties

**URL:** <https://forum.camunda.io/t/camunda-8-5-access-spring-boot-application-properties/57807>\
**Category:** Camunda 8 Topics\
**Tags:** connectors\
**Created:** [December 11, 2024, 1:03pm UTC](https://forum.camunda.io/t/camunda-8-5-access-spring-boot-application-properties/57807 "2024-12-11T13:03:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex3](https://forum.camunda.io/user_avatar/forum.camunda.io/alex3/32/25963_2.png) [@Alex3](https://forum.camunda.io/u/Alex3)\
**Post date:** [December 11, 2024, 1:03pm UTC](https://forum.camunda.io/t/camunda-8-5-access-spring-boot-application-properties/57807/1 "2024-12-11T13:03:14Z")

</div>

I have implemented a simple Camunda Connector:

> @OutboundConnector(  
> name = “MYCONNECTOR”,  
> inputVariables = {  
> “entityName”},  
> type = “io.camunda:my-connector:1”)  
> public class MyConnectorFunction implements OutboundConnectorFunction {
> 
> ```
> @Value("${some.text.var}")
> private String someTextVar;
> 
> @Override
> public Object execute(OutboundConnectorContext context) {
> try {
> final var connectorRequest = context.bindVariables(MyConnectorRequest.class);
> return "Hello, World: " + someTextVar;
> } catch (Exception e) {
> LOGGER.error(e.getMessage(), e);
> throw new RuntimeException(e);
> }
> }
> 
> ```
> 
> }

I created a JSON template for it, connected it to Camunda Modeler, built and deployed the JAR of this connector in Docker using docker-compose in the connectors image.

I also added an `application.properties` file to my connector project and defined a property there:

> some.text.var=Some Test Var1

As you can see from the code above, I am trying to access this property, but it is always null. Is there any mechanism to access Spring properties from a connector, or some way to view the Spring context?

---

<div class="post-metadata">

**Author:** ![sbuettner](https://forum.camunda.io/user_avatar/forum.camunda.io/sbuettner/32/25082_2.png) [@sbuettner](https://forum.camunda.io/u/sbuettner)\
**Post date:** [December 11, 2024, 1:19pm UTC](https://forum.camunda.io/t/camunda-8-5-access-spring-boot-application-properties/57807/2 "2024-12-11T13:19:42Z")

</div>

Hey @Alex3, your connector would need to be on your component scanning path where Spring looks for components. You could then for example inject Springs `Environment` bean.

Here is an example for a Spring Based Connector Test: [connectors/connector-runtime/spring-boot-starter-camunda-connectors/src/test/java/io/camunda/connector/runtime/outbound/SpringBasedOutboundConnectorTest.java at aa994e1ef536054a7ef3a4feb50ae37a0006adf1 · camunda/connectors · GitHub](https://github.com/camunda/connectors/blob/aa994e1ef536054a7ef3a4feb50ae37a0006adf1/connector-runtime/spring-boot-starter-camunda-connectors/src/test/java/io/camunda/connector/runtime/outbound/SpringBasedOutboundConnectorTest.java)

---

<div class="post-metadata">

**Author:** ![Alex3](https://forum.camunda.io/user_avatar/forum.camunda.io/alex3/32/25963_2.png) [@Alex3](https://forum.camunda.io/u/Alex3)\
**Post date:** [December 11, 2024, 1:36pm UTC](https://forum.camunda.io/t/camunda-8-5-access-spring-boot-application-properties/57807/3 "2024-12-11T13:36:56Z")

</div>

Hey @sbuettner , thanks for your answer.

I deploy my connector using Docker Compose as part of the connectors bundle. I added a volume like this:

> connectors: # [https://docs.camunda.io/docs/components/integration-framework/connectors/out-of-the-box-connectors/available-connectors-overview/](https://docs.camunda.io/docs/components/integration-framework/connectors/out-of-the-box-connectors/available-connectors-overview/)  
> image: camunda/connectors-bundle:${CAMUNDA\_CONNECTORS\_VERSION}  
> container\_name: connectors  
> ports:  
> - “8085:8080”  
> environment:  
> - ZEEBE\_CLIENT\_BROKER\_GATEWAY-ADDRESS=zeebe:26500  
> - ZEEBE\_CLIENT\_SECURITY\_PLAINTEXT=true  
> - ZEEBE\_CLIENT\_ID=${ZEEBE\_CLIENT\_ID}  
> …  
> volumes:
> 
> ```
> - myconnector.jar:/opt/app/my-connector.jar
> 
> ```

How can I activate my connector with this setup so that it becomes part of Spring and is included in ComponentScan?

---

<div class="post-metadata">

**Author:** ![sbuettner](https://forum.camunda.io/user_avatar/forum.camunda.io/sbuettner/32/25082_2.png) [@sbuettner](https://forum.camunda.io/u/sbuettner)\
**Post date:** [December 11, 2024, 2:23pm UTC](https://forum.camunda.io/t/camunda-8-5-access-spring-boot-application-properties/57807/4 "2024-12-11T14:23:20Z")

</div>

We have not tried this but in theory you could provide an environment variable to the Connector Runtime that includes your package in the component scan if Spring allows that.

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [March 11, 2025, 2:24pm UTC](https://forum.camunda.io/t/camunda-8-5-access-spring-boot-application-properties/57807/5 "2025-03-11T14:24:01Z")

</div>

Closed on March 11, 2025, 2:24pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
