# Springboot microservices managed by Temporal.io + RabbitMQ

**URL:** <https://community.temporal.io/t/springboot-microservices-managed-by-temporal-io-rabbitmq/1489>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [February 12, 2021, 1:05am UTC](https://community.temporal.io/t/springboot-microservices-managed-by-temporal-io-rabbitmq/1489 "2021-02-12T01:05:19Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Andrex\_17](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/andrex_17/32/727_2.png) [@Andrex\_17](https://community.temporal.io/u/Andrex_17)\
**Post date:** [February 13, 2021, 2:15am UTC](https://community.temporal.io/t/springboot-microservices-managed-by-temporal-io-rabbitmq/1489/7 "2021-02-13T02:15:48Z")

</div>

Great solution!  
Fits perfectly with what I want to achieve.  
I have only one last doubt.  
How can I call an activity present on another from one microservice?  
When I register my workflow implementations in the worker, I also need to define the activities associated with it.  
Being decoupled, how could I make it happen?  
In my POC, I realized this with only a Springboot Application and I’ve all the references inside my prj:

**Worker**

```
@Configuration
public class WorkerManager {

    public WorkerManager() {
      WorkflowServiceStubs service = WorkflowServiceStubs.newInstance();
      WorkflowClient client = WorkflowClient.newInstance(service);
      WorkerFactory factory = WorkerFactory.newInstance(client);

      Worker firstWorker = factory.newWorker("FIRST_TASK_QUEUE");
      firstWorker .registerWorkflowImplementationTypes(FirstWorkflowImpl.class);
      firstWorker .registerActivitiesImplementations(new FirstActivityImpl());

      Worker secondWorker = factory.newWorker("SECOND_TASK_QUEUE");
      secondWorker .registerWorkflowImplementationTypes(SecondWorkflowImpl.class);
      secondWorker .registerActivitiesImplementations(new SecondActivityImpl());

      factory.start();
  }
}

```

**Workflow Impl**

```
public class FirstWorkflowImplimplements FirstWorkflow {

ActivityOptions options = ActivityOptions.newBuilder()
        .setScheduleToCloseTimeout(Duration.ofSeconds(2))
        .setRetryOptions(RetryOptions.newBuilder().setMaximumAttempts(5).setInitialInterval(Duration.ofSeconds(5)).build())
        .build();

private final FirstActivity activity= Workflow.newActivityStub(FirstActivity.class, options);

@Override
public void executionWorkflow(Object someParams) {
    activity.firstActivity(someParams);
    activity.secondActivity(someParams);
}

```

**firstWorker .registerActivitiesImplementations(new FirstActivityImpl());**  
**private final FirstActivity activity= Workflow.newActivityStub(FirstActivity.class, options);**

How can i implement this kind of highlighted initialization in the architecture definited above?  
Could you give me an example?  
Thank you so much for your help, it was very valuable!

---

_[View the full topic](https://community.temporal.io/t/springboot-microservices-managed-by-temporal-io-rabbitmq/1489)._
