Automatically Register App after Startup in Spring Cloud Dataflow - spring

i am using Spring Cloud Dataflow in Kubernetes. Basically i only register a Spring Batch Job that is then triggered by an integration test later. I need this app to be registered straight after the deployment.
I have multiple namespaces, so multiple SCDF instances and thus multiple Ingresses for SCDF.
Instead of registering the app on SCDF manually, i am currently doing it by using the REST API after the deployment.
As there are like 5 different namespaces and 5 different domains of SCDF accordingly, i want to simply this a bit. Ideally, the app gets registered by SCDF configuration out of the box so the app registers the app itself as soon as the app runs. Something like a "default app" or something.
Do you know if there is a possibility to do that?
Thanks in advance!

You can write a Java program to register your application using the DataFlowTemplate or you can write a CLI script using Dataflow Shell, or directly over http using something like curl.

Related

Is it possible to deploy Spring application in SCDF 2.10?

If I have Spring batch jobs bundled within a Spring (Spring version 5.3)application (not a Springboot), Would I still be able to deploy in SCDF-2.10 server, by registering each of these jobs as tasks ? Will this work? Would I be able to register these Spring apps as 'App' in Data flow server? And could I still be able to use Data flow Shell , to register them?
Have already tested Springboot applications on SCDF server by registering as Tasks, but did not find any info on Spring Applications
The SCDF ecosystem was designed around Spring Boot applications. However there is support for polyglot applications.
If the application is packaged in a container and registered as a task, the container will be launched.
If you want it to be visible as a Task then it should include Spring Cloud Task 2.4.x with properties to access the SCDF datasource. These will be provided in the same format as expected by a Spring Boot application.

Access remote Camunda service programmatically

I have a remote server installation of the Camunda BPM Platform (installed using the Camunda BPM Platform Helm Chart - https://github.com/camunda-community-hub/camunda-helm/tree/main/charts/camunda-bpm-platform). It is working as expected and, while new to BPM, I have been able to try out some workflows and examples successfully.
I am now trying to connect to it remotely and register for thrown events. I've been following https://docs.camunda.org/manual/7.15/reference/bpmn20/events/signal-events/ however I am stumped as to how I can get a handle to runtimeService. Other than using the REST API is there another way to connect to a remote Camunda service? I've tried using the camunda-bpm-spring-boot-starter-external-task-client but no RuntimeService gets initialized. Perhaps I'm missing some remote-specific configuration but I have not found anything in the documentation so far. Based on https://camunda.com/best-practices/deciding-about-your-stack/ I understand that this should be possible - however, all examples I've found deal with an embedded service. Any help is appreciated!
CAMUNDA offers a Java API and a REST API. In addition there are official or community client libraries, which all rely on the REST API. The Java API is only available to code which gets deployed inside the CAMUNDA JVM.
To interact with the engine from outside the JVM you have to use the REST API. The endpoints are named after the resources, not after the Java API services. Hence you You will not find a RuntimeService endpoint on the REST API, but you will find all the functionality the RuntimeService offers, e.g. start via process-definition.
If you do not want to deploy code in the CAMUNDA JVM, then service integration is done preferably using the external task pattern. If you want to use Java, especially the new Spring Boot Starter for external task clients is fun to work with. If you prefer other languages, check out https://github.com/camunda/awesome-camunda-external-clients.
Unfortunately there currently is no implementation type external for signal events so far. Ootb you can work with signal events for 1:n communication between different BPMN processes on the same environment. If you want to send the signal to an external event bus, then you need to add this functionality to the same JVM as a one-time effort. Here is an example for Azure event bus: https://github.com/camunda-consulting/code/tree/master/snippets/engine-plugin-signal-to-azure-eventhub. The implementation would look very similar for SQS or other alternatives.
If you need to modify the container image to include custom code then you can either just add own jars to e.g. the CAMUNDA RUN Docker image as shown here: https://github.com/rob2universe/bpmrun-add-to-dockerimg
or you could build your own image based on the Spring Boot Starter as shown here: https://github.com/rob2universe/camunda-aks

Is it ok to connect two camunda instances to the same database?

We are developing a spring boot application(generated with jhipster, with oauth) and we want to use camunda.
The camunda spring boot starter(with the process engine only) worked, however the we had problems with the other two starters(rest, web) in our current setup(although they work with a simple project like in the camunda examples).
We actually prefer using the embedded process engine like this, however, we would like the operational advantages of the camunda webapps.
The preferred solution we thought about was to connect to the same database another process engine(camunda standalone or springboot app with camunda web starter). This seems to be working in our tests.
The other solution would be to use camunda standalone and communicate via rest api, and subscribe to topics for service tasks.
Do you see any problems with the preferred solution?
Yes, it's perfectly fine running two engines against same database. Just make sure to set camunda.bpm.job-execution.enabled=false in the other instance(if you don't want it to pick up and execute jobs)

How do I deploy BPMN process to process engine with Camunda Spring Boot

I have built a Camunda BPM with Spring Boot as a Standalone Process Engine, it will be waiting some requests for starting process from other web applications
now, my co-works have design a few processes in BPMN Tools, I think I should use the REST API deploy these BPMN to Standalone Process Engine, how can I do? or other solution which allows uploading BPMN files to Standalone Process Engine?
Is there any example?
We want to use Camunda BPM in our Application, so we have to solve some problems
Thank you
When you are using Spring Boot as an application container, do you really need to deploy processes at runtime? It seems to me that the common scenario in this case would be "bundle the processes and the application and deploy on startup". If you need to change or add processes, just stop, repackage and start your Camunda Spring Boot application. To do this, the SpringProcessEngineConfiguration allows setting deploymentResources.
If you really need to change processes at runtime, make sure you add the REST API to your Spring Boot bundle and follow https://docs.camunda.org/manual/7.3/api-references/rest/#deployment-post-deployment.
We also have created a Camunda community extension that makes dealing with Camunda and Spring Boot a lot simpler: https://github.com/camunda/camunda-bpm-spring-boot-starter

How to deploy a spring integration component?

I've developed a spring integration component that is to sit on a server and process messages coming in over an inbound RMI channel do some processing/filtering and then send out some messages over a different RMI channel.
Currently, for testing, I've been running it using a Main class that just loads the context, which sets up the inbound RMI gateway and it's working fine. But I don't think that this is appropriate for a production environment.
What is the best way to deploy this type of project to a server?
If I were working in a .Net I'd be deploying this type of application as a windows service, is that what I should be doing here?
The application that is sending me data is hosted in Tomcat, would it be a good idea to also run this application within the same Tomcat container (Current requirements are for both components to be on the same machine this may change)? And if so how?
I'm currently looking into Spring Boot, am I on the right path?
I think the best would be Spring Boot, as it's made to easily allow running different types of applications. Also, you don't need Tomcat if you can run the same component with a simple Main and not using UI. Spring Boot, also, has a sample using Spring Integration here, so you should be up and running in no time.

Resources