spring-cloud-task | Short lived microservices with Spring Batch | Function As A Service library

 by   spring-cloud Java Version: v3.0.1 License: Apache-2.0

kandi X-RAY | spring-cloud-task Summary

kandi X-RAY | spring-cloud-task Summary

spring-cloud-task is a Java library typically used in Serverless, Function As A Service applications. spring-cloud-task has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.

Is a project centered around the idea of processing on demand. A user is able to develop a “task” that can be deployed, executed and removed on demand, yet the result of the process persists beyond the life of the task for future reporting.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spring-cloud-task has a highly active ecosystem.
              It has 377 star(s) with 290 fork(s). There are 55 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 34 open issues and 397 have been closed. On average issues are closed in 147 days. There are 1 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of spring-cloud-task is v3.0.1

            kandi-Quality Quality

              spring-cloud-task has 0 bugs and 0 code smells.

            kandi-Security Security

              spring-cloud-task has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              spring-cloud-task code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              spring-cloud-task is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              spring-cloud-task releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 22545 lines of code, 1590 functions and 252 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed spring-cloud-task and discovered the below as its top functions. This is intended to give you an instant insight into spring-cloud-task implemented functionality, and help decide if they suit your requirements.
            • Executes a job
            • Merge job parameters
            • Returns a copy of JobParameters with non identifiers
            • Throw a TaskException
            • Lock a task
            • Creates the default lock registry
            • Runs the execution
            • Validate the request
            • Get DAO
            • Checks if is SQL server sequence available
            • The thread pool executor
            • Initializes this instance
            • Compares two TaskLaunchRequest objects
            • Registers job execution events
            • DS batch item writer
            • Returns the hashCode of this instance
            • Retrieves all job execution ids for the given task execution id
            • Convert a range into a Range
            • Returns the platform transaction manager
            • Bean batch job item reader
            • Process a step
            • Process a task launch request
            • Create the partition handler
            • The batch item writer
            • Register the hints
            • Initializes the platform
            Get all kandi verified functions for this library.

            spring-cloud-task Key Features

            No Key Features are available at this moment for spring-cloud-task.

            spring-cloud-task Examples and Code Snippets

            No Code Snippets are available at this moment for spring-cloud-task.

            Community Discussions

            QUESTION

            Spring Batch with multi - step Spring Cloud Task (PartitionHandler) for Remote Partition
            Asked 2022-Apr-03 at 07:59

            Latest Update (with an image to hope simplify the problem) (thanks for feedback from @Mahmoud)

            Relate issue reports for other reference (after this original post created, it seem someone filed issues for Spring Cloud on similar issue, so also update there too):

            https://github.com/spring-cloud/spring-cloud-task/issues/793 relate to approach #1

            https://github.com/spring-cloud/spring-cloud-task/issues/792 relate to approach #2

            Also find a workaround resolution for that issue and update on that github issue, will update this once it is confirmed good by developer https://github.com/spring-cloud/spring-cloud-task/issues/793#issuecomment-894617929

            I am developing an application involved multi-steps using spring batch job but hit some roadblock. Did try to research doc and different attempts, but no success. So thought to check if community can shed light

            Spring batch job 1 (received job parameter for setting for step 1/setting for step 2)

            ...

            ANSWER

            Answered 2021-Aug-15 at 13:33
            1. Is above even possible setup?

            yes, nothing prevents you from having two partitioned steps in a single Spring Batch job.

            1. Is it possible to use JobScope/StepScope to pass info to the partitionhandler

            yes, it is possible for the partition handler to be declared as a job/step scoped bean if it needs the late-binding feature to be configured.

            Updated on 08/14/2021 by @DanilKo

            The original answer is correct in high - level. However, to actually achieve the partition handeler to be step scoped, a code modification is required

            Below is the analyze + my proposed workaround/fix (maybe eventually code maintainer will have better way to make it work, but so far below fix is working for me)

            Issue being continued to discuss at: https://github.com/spring-cloud/spring-cloud-task/issues/793 (multiple partitioner handler discussion) https://github.com/spring-cloud/spring-cloud-task/issues/792 (which this fix is based up to use partitionerhandler at step scope to configure different worker steps + resources + max worker)

            Root cause analyze (hypothesis)

            The problem is DeployerPartitionHandler utilize annoation @BeforeTask to force task to pass in TaskExecution object as part of Task setup

            But as this partionerHandler is now at @StepScope (instead of directly at @Bean level with @Enable Task) or there are two partitionHandler, that setup is no longer triggered, as @EnableTask seem not able to locate one partitionhandler during creation.

            https://github.com/spring-cloud/spring-cloud-task/blob/main/spring-cloud-task-batch/src/main/java/org/springframework/cloud/task/batch/partition/DeployerPartitionHandler.java @ 269

            Resulted created DeployerHandler faced a null with taskExecution when trying to launch (as it is never setup)

            https://github.com/spring-cloud/spring-cloud-task/blob/main/spring-cloud-task-batch/src/main/java/org/springframework/cloud/task/batch/partition/DeployerPartitionHandler.java @ 347

            Workaround Resolution

            Below is essentially a workaround to use the current job execution id to retrieve the associated task execution id From there, got that task execution and passed to deploy handler to fulfill its need of taskExecution reference It seem to work, but still not clear if there is other side effect (so far during test not found any)

            Full code can be found in https://github.com/danilko/spring-batch-remote-k8s-paritition-example/tree/attempt_2_partitionhandler_with_stepscope_workaround_resolution

            In the partitionHandler method

            Source https://stackoverflow.com/questions/68647761

            QUESTION

            Spring Cloud Data Flow : Unable to launch multiple instances of the same Task
            Asked 2021-May-13 at 09:21

            TL;DR

            Spring Cloud Data Flow does not allow multiple executions of the same Task even though the documentation says that this is the default behavior. How can we allow SCDF to run multiple instances of the same task at the same time using the Java DSL to launch tasks? To make things more interesting, launching of the same task multiple times works fine when directly hitting the rest enpoints using curl for example.

            Background :

            I have a Spring Cloud Data Flow Task that I have pre-registered in the Spring Cloud Data Flow UI Dashboard

            ...

            ANSWER

            Answered 2021-May-12 at 16:57

            In this case it looks like you are trying to recreate the task definition. You should only need to create the task definition once. From this definition you can launch multiple times. For example:

            Source https://stackoverflow.com/questions/67506703

            QUESTION

            java.lang.ClassNotFoundException on a Spring Cloud Task
            Asked 2020-Sep-25 at 19:18

            I'm trying out a simple Spring Cloud Task application. I'm currently trying to run the said application but somehow I'm ending up with a java.lang.ClassNotFoundException: com.example.sampletask.demotask.DemoTaskApplication.java. I'm trying to tweak the pom.xml file but I'm getting no where so far. Here's what I have as of now:

            The application class:

            ...

            ANSWER

            Answered 2020-Sep-25 at 19:18

            I think you need to drop the .java from this line in your pom.xml:

            Source https://stackoverflow.com/questions/64024347

            QUESTION

            Providing job parameter via Spring Cloud Data Flow UI
            Asked 2020-Aug-16 at 02:27

            There is Data Flow deployed in Docker and a Spring Batch application is deployed as a 'Task' and turned into a task.

            I am trying to provide a year job parameter for my task. I have tried using a properties class with @ConfigurationProperties annotation like in timestamp example. Then I turn this into job parameter via JobParametersIncrementer.

            ...

            ANSWER

            Answered 2020-Aug-16 at 02:27

            The job parameters are passed as Arguments where you don't need to specify the -- prefix. For instance, in this case you need to specify year=2011 as argument in Arguments section.

            Source https://stackoverflow.com/questions/63420316

            QUESTION

            Missing parameters in custom Task for Spring Cloud Data Flow
            Asked 2020-Jun-25 at 04:56

            I'm developing a task to use Spring Cloud Data Flow, but I can't see the execution parameters of my task (which is a Spring Boot application) or how to execute the task.

            I am importing my application as a base and as the project as a base: spring-cloud-starter-task-timestamp

            This is my pom, I made this using Spring Initializr and then using the timestamp-task application for tweaking.

            ...

            ANSWER

            Answered 2020-Jun-25 at 04:56

            You need to add your task application properties into an application metadata that Spring Cloud Data Flow knows how to extract and make them available.

            You can refer this page that walks you through how to add metadata.

            Also, you can check this sample configuration as a reference on how to add such metadata.

            Source https://stackoverflow.com/questions/62559945

            QUESTION

            Difference between Spring Cloud Task and Spring Batch?
            Asked 2020-May-04 at 10:40

            I went through the Introducing Spring Cloud Task, but things are not clear for the following questions.

            I'm using Spring Batch

            1) What's the use of Spring Cloud Task when we already have the metadata provided by Spring Batch ?

            2) We're planning to use Spring Cloud Data Flow to monitor the Spring Batch. All the batch jobs can be imported into the SCDF as task and can be sceduled there, but don't see support for MongoDB. Hope MySQL works well.

            What is the difference between Spring Cloud Task and Spring Batch?

            ...

            ANSWER

            Answered 2020-May-04 at 10:40

            Spring Cloud Task has a broader scope than Spring Batch. It is designed for any short lived task, including but not limited to (Spring) Batch jobs. A short lived task could be a Java process, a shell script, a Docker image, etc. Spring Cloud Task has its own meta-data tables to track the progress/status/stats of tasks.

            In the context of Spring Batch, Spring Cloud Task provides a number of additional features:

            • Batch informational messages: ability to emit messages based on Spring Batch listeners events. Those messages can be consumed by streaming apps and makes it possible to bridge tasks and streaming apps.
            • DeployerPartitionHandler: an additional partition handler that is suitable to cloud environments to dynamically deploy workers in a remote partitioning setup.

            Source https://stackoverflow.com/questions/61579987

            QUESTION

            A job instance already exists and is complete for parameters={-spring.cloud.task.executionid=2}. If you want to run this job again, change the parame
            Asked 2020-Apr-18 at 15:50

            I am working on Spring Cloud Data Flow and Spring Batch by taking a reference from https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples.

            I'm executing the batch-job and when executed this example two times, on 2nd time I observed the error, however for the first time it worked fine.

            I started the spring-cloud-dataflow-server-local server using below commands and it created all metadata for me- highlighted in yellow.

            Error:

            ...

            ANSWER

            Answered 2020-Apr-18 at 15:50

            To resolved this issue, I passed the unique key:value in the Task Argument and I so keeping passing the multiple key:value combinations, then I can run the same Task many times.

            However I wanted to do this programmatically. Any quick solution ?

            Source https://stackoverflow.com/questions/61271924

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install spring-cloud-task

            You can download it from GitHub, Maven.
            You can use spring-cloud-task like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-cloud-task component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/spring-cloud/spring-cloud-task.git

          • CLI

            gh repo clone spring-cloud/spring-cloud-task

          • sshUrl

            git@github.com:spring-cloud/spring-cloud-task.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Function As A Service Libraries

            faas

            by openfaas

            fission

            by fission

            fn

            by fnproject

            cli

            by acode

            lib

            by stdlib

            Try Top Libraries by spring-cloud

            spring-cloud-netflix

            by spring-cloudJava

            spring-cloud-gateway

            by spring-cloudJava

            spring-cloud-kubernetes

            by spring-cloudJava

            spring-cloud-config

            by spring-cloudJava

            spring-cloud-sleuth

            by spring-cloudJava