Skip to content

Commit

Permalink
Adapt to SpringBoot 3, Camel 4 and Jakarta EE, removing DBCP feature …
Browse files Browse the repository at this point in the history
…and deprecated methods
  • Loading branch information
graben committed May 23, 2023
1 parent cc543a8 commit 61b5a05
Show file tree
Hide file tree
Showing 50 changed files with 385 additions and 1,449 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: Java CI with Maven
on:
push:
branches: [ main ]
branches: '**'
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: '17'
distribution: 'temurin'
- name: Install
run: ./mvnw install -DskipTests
- name: Test
Expand Down
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
19 changes: 18 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
34 changes: 9 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,21 @@ for each instance of your application.

# Using databases

This Narayana starter supports two ways to enlist a relational database to a JTA transaction: Narayana Transactional
Driver and DBCP2.

By default Narayana Transactional driver is used which provides a basic XAResource enlistment and recovery.
By default Narayana Transactional driver is used to enlist a relational database to a JTA transaction which provides a basic XAResource enlistment and recovery.

## Add pooling

If you need a more sophisticated connection management, you can enable DBCP2 support which provides connection pooling
and many other features. To enable DBCP2 add the following property to you application configuration:
```
narayana.dbcp.enabled=true
```
All DBCP2 configuration properties described in its
[documentation](https://commons.apache.org/proper/commons-dbcp/configuration.html) are mapped with a prefix
`narayana.dbcp`. So for example if you'd like to set an initial pool size to 10, you could do that by adding this entry
to your application configuration:
```
narayana.dbcp.initialSize=10
```

## Add last resource commit optimization

If you are forced to use a non-xa DataSource to connect to your database you can auto wrap a JDBC Driver instance in a
special XADataSource instance with last resource commit optimization enabled by adding this entry to your application
configuration:
If you need a more sophisticated connection management, we advice you to use [agroal-spring-boot-starter](https://agroal.github.io)
which provides connection pooling and many other features. To enable Agroal add the following dependency to your application configuration:
```
narayana.dbcp.enabled=true
narayana.lrco.enabled=true
<dependency>
<groupId>io.agroal</groupId>
<artifactId>agroal-spring-boot-starter</artifactId>
<version>2.x.x</version>
</dependency>
```

> Due to Narayana internal design restrictions, last resource commit optimization is supported for pooled DataSources only.
All Agroal configuration properties described in its [documentation](https://agroal.github.io/docs.html)

# Using messaging brokers

Expand Down
Loading

0 comments on commit 61b5a05

Please sign in to comment.