narayana-gemfire82-springboot

Provides a seamless integration of Geode/Gemfire and the Narayana standalone JTA server and LRCO support. It extends the core narayana-geode-core package adding Spring and SpringBoot support like auto-configuration and @EnableGeodeNarayanaJta annotation. To be used in SpringBoot and Spring Data Gemfire projects.

License

License

Categories

Categories

Data Narayana Application Layer Libs Distributed Transactions Geo Business Logic Libraries Geospatial
GroupId

GroupId

io.datalake.geode.jta
ArtifactId

ArtifactId

narayana-gemfire82-springboot
Last Version

Last Version

0.1.11
Release Date

Release Date

Type

Type

jar
Description

Description

narayana-gemfire82-springboot
Provides a seamless integration of Geode/Gemfire and the Narayana standalone JTA server and LRCO support. It extends the core narayana-geode-core package adding Spring and SpringBoot support like auto-configuration and @EnableGeodeNarayanaJta annotation. To be used in SpringBoot and Spring Data Gemfire projects.
Project URL

Project URL

https://github.com/tzolov/narayana-jta-geode-support

Download narayana-gemfire82-springboot

How to add to project

<!-- https://jarcasting.com/artifacts/io.datalake.geode.jta/narayana-gemfire82-springboot/ -->
<dependency>
    <groupId>io.datalake.geode.jta</groupId>
    <artifactId>narayana-gemfire82-springboot</artifactId>
    <version>0.1.11</version>
</dependency>
// https://jarcasting.com/artifacts/io.datalake.geode.jta/narayana-gemfire82-springboot/
implementation 'io.datalake.geode.jta:narayana-gemfire82-springboot:0.1.11'
// https://jarcasting.com/artifacts/io.datalake.geode.jta/narayana-gemfire82-springboot/
implementation ("io.datalake.geode.jta:narayana-gemfire82-springboot:0.1.11")
'io.datalake.geode.jta:narayana-gemfire82-springboot:jar:0.1.11'
<dependency org="io.datalake.geode.jta" name="narayana-gemfire82-springboot" rev="0.1.11">
  <artifact name="narayana-gemfire82-springboot" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.datalake.geode.jta', module='narayana-gemfire82-springboot', version='0.1.11')
)
libraryDependencies += "io.datalake.geode.jta" % "narayana-gemfire82-springboot" % "0.1.11"
[io.datalake.geode.jta/narayana-gemfire82-springboot "0.1.11"]

Dependencies

compile (1)

Group / Artifact Type Version
io.datalake.geode.jta : narayana-gemfire82-core jar 0.1.11

provided (17)

Group / Artifact Type Version
com.gemstone.gemfire » gemfire jar 8.2.5
ch.qos.logback : logback-classic jar 1.1.11
org.slf4j : jcl-over-slf4j jar 1.7.25
org.slf4j : jul-to-slf4j jar 1.7.25
org.slf4j : log4j-over-slf4j jar 1.7.25
org.jboss : jboss-transaction-spi jar 7.6.0.Final
org.jboss.narayana.jta : jdbc jar 5.5.24.Final
org.jboss.narayana.jta : jms jar 5.5.24.Final
org.jboss.narayana.jta : jta jar 5.5.24.Final
org.jboss.narayana.jts : narayana-jts-integration jar 5.5.24.Final
javax.transaction : javax.transaction-api jar 1.2
org.springframework : spring-context jar 4.3.9.RELEASE
org.springframework : spring-aop jar 4.3.9.RELEASE
org.aspectj : aspectjweaver jar 1.8.10
org.apache.tomcat : tomcat-jdbc jar 8.5.15
org.springframework : spring-jdbc jar 4.3.9.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 1.5.4.RELEASE

Project Modules

There are no modules declared in this project.

Narayana (e.g. JBoss) JTA with Geode/GemFire

Download

Use Narayana JTA provider as global transaction manager to coordinate Geode/GemFire cache transactions along with JPA/JDBC and/or JMS resources.

Narayana is light-weight (e.g. out-of-container), embeddable global transaction manager. Narayana is JTA compliant and can be integrated with Geode/GemFire to perform XA transaction across Geode, JPA/JDBC and JMS operations.

Also Narayana supports Last Resource Commit Optiomization allowing with Geode/GemFire transactions to be run as last resources.

The narayana-geode extends the existing Geode JTA support by integrating a standalone (open-source) JTA provider and enabling LRCO for transaction-atomicity and data-consistency. The utility includes two sub-projects:

The Apache Geode(GemFire) + Narayana JTA = Global Transactions with Last-Resource Optimization explains the problem, the implemented solution and provides some how-use tips.

Narayana Geode/Gemfire Core

The narayana-geode-core library uses minimal external dependencies. Only Narayana and the Apache Geode/Gemfire APIs are needed (e.g. no dependencies on Spring or Spring Data Gemfire and so.) The narayana-geode-core README explains how to use the core utility.

Narayana Geode/Gemfire SpringBoot

The narayana-geode-springboot library extends narayana-geode-core to provide seamless integration with Spring Boot and Spring Data Gemfire (SDG).

The narayana-geode-springboot README explains how to use the core utility.

Quick Start

Show how to bootstrap a Spring Boot application that uses Narayana to manage global transactions between JPA and Gemfire (8.2.x).

  • Use the start.spring.io link to generate new Spring Boot application, pre-configured with Narayana, JPA, H2 and Gemfire 8.2.x starters.

  • Add narayana-gemfire82-springboot to the POM to enable the Narayana/Gemfire 8.2.x integration. The dependency are resolved from Maven Central

<dependency>
   <groupId>io.datalake.geode.jta</groupId>
   <artifactId>narayana-gemfire82-springboot</artifactId>
   <version>0.1.11</version>
</dependency>
  • Enable the Transaction Management and Geode Narayana JTA.
 @SpringBootApplication
 @EnableGeodeNarayanaJta
 @EnableTransactionManagement(order = 1)
 public class SampleNarayanaApplication implements CommandLineRunner {   ... }
  • Use the Spring Data idioms to create and configure JPA and Geode repositories.
public interface MyJpaRepository extends CrudRepository<JpaCustomer, Long> {...}
public interface MyGeodeRepository extends CrudRepository<GeodeCustomer, Long> {...}
@SpringBootApplication
@EnableJpaRepositories(basePackageClasses = JpaCustomer.class)
@EnableGemfireRepositories(basePackageClasses = GeodeCustomer.class)
...
  • Use the @Transactional Spring idioms to participate in a distributed transactions
@Transactional
public void addNewCustomer(String firstName, String lastName) {
   jpaRepository.save(new JpaCustomer(firstName, lastName));
   geodeRepository.save(new GeodeCustomer(666L, firstName, lastName));
}

POM dependencies

All narayana-geode dependencies can be resolved from Maven Central: io.datalake.geode.jta

Currently narayana-geode support Gemfire 8.2.x, Gemfire 9.0.x and Geode 1.1.x. See matrix for details:

POM Group POM Artifact POM Version Compatible Apache Geode/Gemfire Versions
io.datalake.geode.jta narayana-geode-core 0.1.11+ Apache Geode 1.1.x or newer, Gemfire 9.0.4 or newer
io.datalake.geode.jta narayana-geode-springboot 0.1.11+ Apache Geode 1.1.x or newer, Gemfire 9.0.4 or newer, SpringBoot 1.5.4 or newer. No SDG GA for this Geode/Gemfire version yet.
io.datalake.geode.jta narayana-gemfire82-core 0.1.11+ Gemfire 8.2.x
io.datalake.geode.jta narayana-gemfire82-springboot 0.1.11+ Gemfire 8.2.x, SpringBoot 1.5.4 or newer, Spring Data Gemfire 1.9.4

Build

To build the projects run

./mvn clean install

Versions

Version
0.1.11
0.1.10