Skip to content

Commit

Permalink
Merge pull request #131 from assimbly/develop
Browse files Browse the repository at this point in the history
Release 4.0.1
  • Loading branch information
skin27 committed Jun 12, 2023
2 parents a694944 + 5bcaf00 commit 0047096
Show file tree
Hide file tree
Showing 47 changed files with 353 additions and 401 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/manual-update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ on:
description: '4.0.0'
required: true
default: '4.0.0'

push:
branches:
- 'update-development-version'

jobs:
update_version:
Expand All @@ -28,11 +24,11 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v3
with:
ref: 'develop'
ref: ${{ inputs.BRANCH }}

- name: Update POM Version
env:
VERSION: '4.0.0-SNAPSHOT'
VERSION: ${{ inputs.VERSION }}
run: |
echo "Updating to version: $VERSION"
mvn versions:set -DnewVersion=$VERSION
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: New Release Workflow

on:

release:
types: [ released ]

jobs:

publish_prod_packages:

name: Publish Snapshot Packages
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
ref: 'master'

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Update to snapshot version
env:
VERSION: ${{ github.ref_name }}
run: |
echo "Updating to version: ${VERSION}"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${VERSION}
mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=${VERSION}
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish_snapshot_packages:

name: Publish Snapshot Packages
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
ref: 'develop'

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Update to snapshot version
env:
SNAPSHOT_VERSION: ${{ github.ref_name }}-SNAPSHOT
run: |
echo "Updating to version: ${SNAPSHOT_VERSION}"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${SNAPSHOT_VERSION}
mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=${SNAPSHOT_VERSION}
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


60 changes: 0 additions & 60 deletions .github/workflows/release-publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>runtime</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<name>broker</name>
Expand Down
2 changes: 1 addition & 1 deletion brokerRest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>runtime</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<name>broker-rest</name>
Expand Down
2 changes: 1 addition & 1 deletion dil/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>runtime</artifactId>
<groupId>org.assimbly</groupId>
<version>4.0.0</version>
<version>4.0.1</version>
</parent>

<name>dil</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

public class AggregateStrategy implements AggregationStrategy {

protected Logger log = LoggerFactory.getLogger(getClass());

private AggregationStrategy aggregateStrategy;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

public class EnrichStrategy implements AggregationStrategy {

protected Logger log = LoggerFactory.getLogger(getClass());

private AggregationStrategy enrichStrategy;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Exchange aggregate(Exchange original, Exchange resource) {

Message resourceMessage;

if(resource == null){
if(resource != null){
resourceMessage = resource.getIn();
}else{
log.error("Could not get a response from your requested resource.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

public class JsonEnrichStrategy implements AggregationStrategy {

protected Logger log = LoggerFactory.getLogger(getClass());

@Override
public Exchange aggregate(Exchange original, Exchange resource) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

public class OverrideEnrichStrategy implements AggregationStrategy {

protected Logger log = LoggerFactory.getLogger(getClass());

@Override
public Exchange aggregate(Exchange original, Exchange resource) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

public class JsonAggregateStrategy implements AggregationStrategy {

protected Logger log = LoggerFactory.getLogger(getClass());

@Override
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class Connection {
private CamelContext context;
private String stepType;
private Object stepId;

private String connectionType;
private static final Random RANDOM = new Random();

public Connection(CamelContext context, TreeMap<String, String> properties, String key) {
this.context = context;
Expand Down Expand Up @@ -65,7 +65,7 @@ private void startConnection() throws Exception{
new ActiveMQConnection(context, decryptedProperties, connectionId, "amazonmq").start();
break;
case "SonicMQ":
String connectId = stepType + connectionIdValue + new Random().nextInt(1000000);
String connectId = stepType + connectionIdValue + RANDOM.nextInt(1000000);
new SonicMQConnection(context, decryptedProperties, connectionId, "sonicmq").start(flowId, connectId, connectionIdValue);
uri = uri.replace("sonicmq:", "sonicmq." + flowId + connectId + ":");
properties.put(stepType + "." + stepId + ".uri", uri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ private String createSSLEnabledUrl(String url) {
String modifiedUrl = "";
String multipleUrls;

if (url.indexOf(",") == -1) {
if (url.indexOf(',') == -1) {
log.info("SSLEnabled Normal Url: ");
modifiedUrl = addSSLParameterToUrl(url);
}else{
log.info("SSLEnabled Failover Url: ");

if (url.indexOf("(") != -1) {
if (url.indexOf('(') != -1) {
multipleUrls = StringUtils.substringBetween(url,"(",")");
}else{
multipleUrls = url;
Expand All @@ -110,7 +110,7 @@ private String createSSLEnabledUrl(String url) {
}
}

if (url.indexOf("(") != -1) {
if (url.indexOf('(') != -1) {
modifiedUrl = "failover:(" + modifiedUrl + ")";
}

Expand All @@ -131,7 +131,7 @@ private String addSSLParameterToUrl(String url){
String baseDirURI = baseDir.replace("\\", "/");

String sslUrl = url;
if (url.indexOf("?") == -1) {
if (url.indexOf('?') == -1) {
sslUrl = url + "?transport.verifyHost=false&transport.trustAll=true&transport.trustStoreLocation=" + baseDirURI + "/security/truststore.jks" + "&transport.trustStorePassword=supersecret";
} else {
String[] urlSplitted = url.split("/?");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public void process(Exchange exchange) throws Exception {
.filter(map -> map.getKey().startsWith("message." + stepId))
.collect(Collectors.toMap(map -> map.getKey(), map -> map.getValue()));

XPathFactory fac = new net.sf.saxon.xpath.XPathFactoryImpl();

for (Map.Entry<String, String> entry : headers.entrySet()) {

String language = StringUtils.substringBetween(entry.getKey(), stepId + ".", ".");
Expand All @@ -57,7 +59,6 @@ public void process(Exchange exchange) throws Exception {
} else if (language.equalsIgnoreCase("constant")) {
result = value;
} else if (language.equalsIgnoreCase("xpath")) {
XPathFactory fac = new net.sf.saxon.xpath.XPathFactoryImpl();
result = XPathBuilder.xpath(value).factory(fac).evaluate(exchange, String.class);
} else {
Language resolvedLanguage = exchange.getContext().resolveLanguage(language);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public void process(Exchange exchange) throws Exception {

String language;
String type;

XPathFactory fac = new net.sf.saxon.xpath.XPathFactoryImpl();

if (node.getNodeType() == Node.ELEMENT_NODE) {
String headerKey = node.getNodeName();
String headerValue = node.getTextContent();
Expand All @@ -43,7 +44,6 @@ public void process(Exchange exchange) throws Exception {
if (language.equalsIgnoreCase("constant")) {
result = headerValue;
} else if (language.equalsIgnoreCase("xpath")) {
XPathFactory fac = new net.sf.saxon.xpath.XPathFactoryImpl();
result = XPathBuilder.xpath(headerValue).factory(fac).evaluate(exchange, String.class);
} else {
Language resolvedLanguage = exchange.getContext().resolveLanguage(language);
Expand Down
Loading

0 comments on commit 0047096

Please sign in to comment.