kandi background
Explore Kits

gs-batch-processing | Batch Service : : Learn how to create a basic batch | BPM library

 by   spring-guides Java Version: Current License: Apache-2.0

 by   spring-guides Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | gs-batch-processing Summary

gs-batch-processing is a Java library typically used in Automation, BPM, Docker applications. gs-batch-processing has no vulnerabilities, it has a Permissive License and it has low support. However gs-batch-processing has 1 bugs and it build file is not available. You can download it from GitHub.
This guide walks you through the process of creating a basic batch-driven solution.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • gs-batch-processing has a low active ecosystem.
  • It has 150 star(s) with 304 fork(s). There are 36 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 0 open issues and 13 have been closed. On average issues are closed in 303 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of gs-batch-processing is current.
gs-batch-processing Support
Best in #BPM
Average in #BPM
gs-batch-processing Support
Best in #BPM
Average in #BPM

quality kandi Quality

  • gs-batch-processing has 1 bugs (0 blocker, 0 critical, 0 major, 1 minor) and 2 code smells.
gs-batch-processing Quality
Best in #BPM
Average in #BPM
gs-batch-processing Quality
Best in #BPM
Average in #BPM

securitySecurity

  • gs-batch-processing has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • gs-batch-processing code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
gs-batch-processing Security
Best in #BPM
Average in #BPM
gs-batch-processing Security
Best in #BPM
Average in #BPM

license License

  • gs-batch-processing 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.
gs-batch-processing License
Best in #BPM
Average in #BPM
gs-batch-processing License
Best in #BPM
Average in #BPM

buildReuse

  • gs-batch-processing releases are not available. You will need to build from source code and install.
  • gs-batch-processing has no build file. You will be need to create the build yourself to build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 257 lines of code, 17 functions and 8 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
gs-batch-processing Reuse
Best in #BPM
Average in #BPM
gs-batch-processing Reuse
Best in #BPM
Average in #BPM
Top functions reviewed by kandi - BETA

kandi has reviewed gs-batch-processing and discovered the below as its top functions. This is intended to give you an instant insight into gs-batch-processing implemented functionality, and help decide if they suit your requirements.

  • bean data reader .
    • Verify that a BatchJob completes .
      • Converts the person into a person object .
        • Import user job .
          • String representation .
            • Entry point for the BatchProcessing application .
              • Set the first name .

                Get all kandi verified functions for this library.

                Get all kandi verified functions for this library.

                gs-batch-processing Key Features

                What You Will build

                What You Need

                Business Data

                Starting with Spring Initializr Manual Initialization (optional)

                Create a Business Class

                Create an Intermediate Processor

                Put Together a Batch Job

                Make the Application Executable

                Summary

                See also

                Business Data

                copy iconCopydownload iconDownload
                link:initial/src/main/resources/sample-data.csv[]

                Starting with Spring Initializr

                copy iconCopydownload iconDownload
                link:complete/pom.xml[]

                Create a Business Class

                copy iconCopydownload iconDownload
                link:complete/src/main/java/com/example/batchprocessing/Person.java[]

                Create an Intermediate Processor

                copy iconCopydownload iconDownload
                link:complete/src/main/java/com/example/batchprocessing/PersonItemProcessor.java[]

                Put Together a Batch Job

                copy iconCopydownload iconDownload
                link:complete/src/main/java/com/example/batchprocessing/BatchConfiguration.java[]
                
                    ...
                
                }

                Make the Application Executable

                copy iconCopydownload iconDownload
                link:complete/src/main/java/com/example/batchprocessing/BatchProcessingApplication.java[]

                Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented if hibernate dependency is absent

                copy iconCopydownload iconDownload
                compile('org.hibernate:hibernate-core:5.4.2.Final')
                
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                    <version>5.4.2.Final</version>
                </dependency>
                
                compile('org.hibernate:hibernate-core:5.4.2.Final')
                
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                    <version>5.4.2.Final</version>
                </dependency>
                

                FlatFileItemReader tab delimiter not working

                copy iconCopydownload iconDownload
                public DelimitedLineTokenizer build() {
                        Assert.notNull(this.fieldSetFactory, "A FieldSetFactory is required.");
                        Assert.notEmpty(this.names, "A list of field names is required");
                
                        DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
                
                        tokenizer.setNames(this.names.toArray(new String[this.names.size()]));
                
                        // the hasText ignores the tab delimiter.
                
                        if(StringUtils.hasText(this.delimiter)) {
                            tokenizer.setDelimiter(this.delimiter);
                        }
                // more code
                
                @Bean
                public FlatFileItemReader<Person> reader() {
                    return new FlatFileItemReaderBuilder<Person>().name("personItemReader")
                            .resource(new ClassPathResource("sample-data.csv"))
                            .lineMapper(lineMapper()).build();
                }
                
                @Bean
                public DefaultLineMapper<Person> lineMapper(){
                      DefaultLineMapper<Person> lineMapper = new DefaultLineMapper<>();
                      lineMapper.setLineTokenizer(lineTokenizer());
                      lineMapper.setFieldSetMapper(new BeanWrapperFieldSetMapper<Person>() {
                                {
                                    setTargetType(Person.class);
                                }
                            });
                      return lineMapper;
                }
                
                @Bean
                public DelimitedLineTokenizer lineTokenizer() {
                    DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer(DelimitedLineTokenizer.DELIMITER_TAB);
                    tokenizer.setNames(new String[] { "firstName", "lastName" });
                    return tokenizer;
                }
                
                public DelimitedLineTokenizer build() {
                        Assert.notNull(this.fieldSetFactory, "A FieldSetFactory is required.");
                        Assert.notEmpty(this.names, "A list of field names is required");
                
                        DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
                
                        tokenizer.setNames(this.names.toArray(new String[this.names.size()]));
                
                        // the hasText ignores the tab delimiter.
                
                        if(StringUtils.hasText(this.delimiter)) {
                            tokenizer.setDelimiter(this.delimiter);
                        }
                // more code
                
                @Bean
                public FlatFileItemReader<Person> reader() {
                    return new FlatFileItemReaderBuilder<Person>().name("personItemReader")
                            .resource(new ClassPathResource("sample-data.csv"))
                            .lineMapper(lineMapper()).build();
                }
                
                @Bean
                public DefaultLineMapper<Person> lineMapper(){
                      DefaultLineMapper<Person> lineMapper = new DefaultLineMapper<>();
                      lineMapper.setLineTokenizer(lineTokenizer());
                      lineMapper.setFieldSetMapper(new BeanWrapperFieldSetMapper<Person>() {
                                {
                                    setTargetType(Person.class);
                                }
                            });
                      return lineMapper;
                }
                
                @Bean
                public DelimitedLineTokenizer lineTokenizer() {
                    DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer(DelimitedLineTokenizer.DELIMITER_TAB);
                    tokenizer.setNames(new String[] { "firstName", "lastName" });
                    return tokenizer;
                }
                
                @Bean
                public FlatFileItemReader<Person> reader() {
                    return new FlatFileItemReaderBuilder<Person>()
                            .name("personItemReader")
                            .resource(new ClassPathResource("sample-data.csv"))
                            .lineTokenizer(new DelimitedLineTokenizer(DelimitedLineTokenizer.DELIMITER_TAB) {{
                                setNames(new String[]{"firstName", "lastName"});
                            }})
                            .fieldSetMapper(new BeanWrapperFieldSetMapper<Person>() {{
                                setTargetType(Person.class);
                            }})
                            .build();
                }
                

                Community Discussions

                Trending Discussions on gs-batch-processing
                • Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented if hibernate dependency is absent
                • FlatFileItemReader tab delimiter not working
                • FlatFileItemWriter cannot create new file or update existing file
                • Unable to avoid job triggering at Start up
                Trending Discussions on gs-batch-processing

                QUESTION

                Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented if hibernate dependency is absent

                Asked 2019-Aug-07 at 16:15

                I've created small hello world project for spring batch:

                build.gradle:

                buildscript {
                    repositories {
                        mavenCentral()
                    }
                    dependencies {
                        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.6.RELEASE")
                    }
                }
                
                apply plugin: 'java'
                apply plugin: 'eclipse'
                apply plugin: 'idea'
                apply plugin: 'org.springframework.boot'
                apply plugin: 'io.spring.dependency-management'
                
                bootJar {
                    baseName = 'gs-batch-processing'
                    version = '0.1.0'
                }
                
                repositories {
                    mavenCentral()
                }
                
                sourceCompatibility = 1.8
                targetCompatibility = 1.8
                
                dependencies {
                    compile("org.springframework.boot:spring-boot-starter-batch")
                    compile("org.postgresql:postgresql")
                    compile("org.springframework.boot:spring-boot-starter-data-jpa")
                    //to fix exception on startup
                    //compile('org.hibernate:hibernate-core:5.4.2.Final')
                
                    testCompile("junit:junit")
                }
                

                configuration:

                @Configuration
                @EnableBatchProcessing
                public class BatchConfiguration {
                    @Autowired
                    public JobBuilderFactory jobBuilderFactory;
                
                    @Autowired
                    public StepBuilderFactory stepBuilderFactory;
                
                    @Autowired
                    private DbPersonWriter dbPersonWriter;
                
                    @Autowired
                    private ToLowerCasePersonProcessor toLowerCasePersonProcessor;
                
                    @Value("${app.users-location}")
                    Resource csvResource;
                
                    @Bean
                    public Job job() {
                        return jobBuilderFactory.get("myJob")
                                .incrementer(new RunIdIncrementer())
                                .flow(csvToDataBaseStep())
                                .end()
                                .build();
                    }
                
                    private Step csvToDataBaseStep() {
                        return stepBuilderFactory.get("csvToDatabaseStep")
                                .<Person, Person>chunk(100)
                                .reader(csvPersonReader())
                                .processor(toLowerCasePersonProcessor)
                                .writer(dbPersonWriter)
                                .build();
                
                    }
                

                on startup I see following exception:

                java.lang.reflect.InvocationTargetException: null
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
                    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
                    at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.useContextualLobCreation(LobCreatorBuilderImpl.java:113) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.makeLobCreatorBuilder(LobCreatorBuilderImpl.java:54) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl.<init>(JdbcEnvironmentImpl.java:271) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:114) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:94) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:179) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:119) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:904) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:935) [hibernate-core-5.3.10.Final.jar:5.3.10.Final]
                    at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) [spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) [spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) [spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) [spring-orm-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837) [spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774) [spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) [spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) [spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
                    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
                    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
                    at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
                    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
                    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
                    at spring.boot.hello.world.MyApplication.main(MyApplication.java:9) ~[main/:na]
                Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
                    at org.postgresql.Driver.notImplemented(Driver.java:688) ~[postgresql-42.2.5.jar:42.2.5]
                    at org.postgresql.jdbc.PgConnection.createClob(PgConnection.java:1269) ~[postgresql-42.2.5.jar:42.2.5]
                    ... 43 common frames omitted
                

                I have to say that everything is working as expected and this trace just litter my logs. But I want to avoid it.

                I've found workaround to fix it( thx this topic How to resolve org.postgresql.jdbc.PgConnection.createClob() is not yet implemented):

                just added dependency and excption disappeared:

                compile('org.hibernate:hibernate-core:5.4.2.Final')
                

                Is there more elegant way? I don't think that workaround is a good solution

                P.S.

                To play with source code you can follow my github repo

                ANSWER

                Answered 2019-Aug-07 at 16:15

                This was a Hibernate issue. If you are using Spring Boot latest version from 2.0.x to 2.1.x includes Hibernate 5.3.10.final you can take a look here but this issue was fixed on Hibernate version 5.4.0.CR1 then you need to add that dependency or if it is possible the latest version:

                For Gradle:

                compile('org.hibernate:hibernate-core:5.4.2.Final')
                

                For Maven:

                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                    <version>5.4.2.Final</version>
                </dependency>
                

                UPDATED "SPRING BOOT 2.2.0.M(1-4)"

                In addition Spring boot v2.2.0.Mx includes now Hibernate v5.4.x then this issue was fixed for these versions.

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

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

                Vulnerabilities

                No vulnerabilities reported

                Install gs-batch-processing

                You can download it from GitHub.
                You can use gs-batch-processing 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 gs-batch-processing 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 .

                DOWNLOAD this Library from

                Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                over 430 million Knowledge Items
                Find more libraries
                Reuse Solution Kits and Libraries Curated by Popular Use Cases
                Explore Kits

                Save this library and start creating your kit

                Explore Related Topics

                Share this Page

                share link
                Consider Popular BPM Libraries
                Try Top Libraries by spring-guides
                Compare BPM Libraries with Highest Support
                Compare BPM Libraries with Highest Quality
                Compare BPM Libraries with Highest Security
                Compare BPM Libraries with Permissive License
                Compare BPM Libraries with Highest Reuse
                Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                over 430 million Knowledge Items
                Find more libraries
                Reuse Solution Kits and Libraries Curated by Popular Use Cases
                Explore Kits

                Save this library and start creating your kit

                • © 2022 Open Weaver Inc.