Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/assimbly/gateway into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
skin27 committed Oct 25, 2024
2 parents 22989ec + a0ee859 commit 149d70d
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release-daily-develop-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Release Daily Development Snapshot

on:
workflow_dispatch:
# schedule:
# - cron: '0 2 * * *'

schedule:
- cron: '0 3 * * *'

jobs:
getversion:
Expand Down
15 changes: 3 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ configurations.all {
exclude group: "org.apache.logging.log4j", module: 'log4j-slf4j-impl'
exclude group: 'commons-logging', module: 'commons-logging'
exclude group: 'xerces', module: 'xercesImpl'
//exclude group: 'org.eclipse.angus', module: 'angus-activation'
resolutionStrategy {
force 'org.eclipse.angus:angus-mail:2.0.3'
force 'jakarta.mail:jakarta.mail-api:2.1.3'
force 'jakarta.activation:jakarta.activation-api:2.1.3'
}
}

if (project.hasProperty("headless")) {
Expand Down Expand Up @@ -154,7 +148,8 @@ jib {
image = 'assimbly/gateway-full'
}
container {
ports = ['1000', '1616','1617', '2000-2003/udp', '8088', '8443', '61616','61617','9000','9001']
mainClass = 'org.assimbly.gateway.GatewayApp'
ports = ['1000','1616','1617','2000-2003/udp','8088','8443','9000','9001','27017','61616','61617']
format = 'OCI'
}
containerizingMode = 'exploded'
Expand All @@ -165,7 +160,7 @@ jib {
from = file('src/main/jib')
}
path {
// copies the contents of 'src/main/another/dir' into '/extras' on the container
// copies the contents of 'src/main/data' into '/data' on the container
from = file('src/main/data')
into = '/data'
}
Expand Down Expand Up @@ -351,10 +346,6 @@ dependencies {

compileOnly "jakarta.servlet:jakarta.servlet-api:6.1.0"

implementation "org.eclipse.angus:angus-mail:2.0.3"
implementation "jakarta.mail:jakarta.mail-api:2.1.3"
implementation "jakarta.activation:jakarta.activation-api:2.1.3"

implementation "io.dropwizard.metrics:metrics-core"
implementation "io.dropwizard.metrics:metrics-json"

Expand Down
4 changes: 2 additions & 2 deletions scripts/version/versioned_files.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"applicationName": "gateway",
"oldVersion": "5.0.0",
"newVersion": "5.0.0",
"oldVersion": "5.0.1-SNAPSHOT",
"newVersion": "5.0.1-SNAPSHOT",
"resources": [
{
"path": "/package.json"
Expand Down
4 changes: 4 additions & 0 deletions src/main/docker/jib/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ file_env 'SPRING_LIQUIBASE_USER'
file_env 'SPRING_LIQUIBASE_PASSWORD'
file_env 'JHIPSTER_REGISTRY_PASSWORD'

# exploded
exec java ${JAVA_OPTS} -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -cp /app/resources/:/app/classes/:/app/libs/* "org.assimbly.gateway.GatewayApp" "$@" --application.gateway.base-directory=/data/ --server.port=8088

# packaged
#exec java ${JAVA_OPTS} -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -cp @/app/jib-classpath-file @/app/jib-main-class-file "$@" --application.gateway.base-directory=/data/ --server.port=8088
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoDatabase;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;
Expand All @@ -18,6 +19,8 @@
@Configuration
public class MongoClientProvider implements Serializable {

private final String MONGO_CONTAINER_NAME = "MONGO_CONTAINER_NAME";

private static final MongoClientProvider INSTANCE = new MongoClientProvider();

private static MongoClient client;
Expand Down Expand Up @@ -48,8 +51,16 @@ MongoDatabase getDatabase(String name) {
private void init() {
client = MongoClients.create(MongoClientSettings.builder()
.applyToClusterSettings(builder ->
builder.hosts(Arrays.asList(new ServerAddress("flux-mongo", 27017))))
builder.hosts(Arrays.asList(new ServerAddress(getMongoContainerName(), 27017))))
.build());
}

private String getMongoContainerName() {
String mongoContainer = System.getenv(MONGO_CONTAINER_NAME);
if (StringUtils.isNotEmpty(mongoContainer)) {
return mongoContainer;
}
return "flux-mongo"; // by default
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class TenantVariable {
public static final String ID_FIELD = "_id";
public static final String TYPE_FIELD = "_type";
public static final String NAME_FIELD = "name";
public static final String STATIC_TENANT_VARIABLE_GROUP_ID_FIELD = "static_tenant_variable_group_id";
public static final String CREATED_AT_FIELD = "createdAt";
public static final String CREATED_BY_FIELD = "createdBy";
public static final String VALUES_FIELD = "values";
Expand All @@ -24,6 +25,7 @@ public enum TenantVarType {
private ObjectId _id;
private String _type;
private String name;
private ObjectId staticTenantVariableGroupId;
private long createdAt;
private String createdBy;

Expand All @@ -32,20 +34,23 @@ public enum TenantVarType {
public TenantVariable(){
this._id = new ObjectId();
this._type = TenantVarType.TenantVariable.name();
this.staticTenantVariableGroupId = new ObjectId();
this.values = new ArrayList<>();
}

public TenantVariable(String name){
this._id = new ObjectId();
this._type = TenantVarType.TenantVariable.name();
this.name = name;
this.staticTenantVariableGroupId = new ObjectId();
this.values = new ArrayList<>();
}

public TenantVariable(String name, TenantVarType tenantVarType){
this._id = new ObjectId();
this._type = tenantVarType.name();
this.name = name;
this.staticTenantVariableGroupId = new ObjectId();
this.values = new ArrayList<>();
}

Expand All @@ -70,6 +75,7 @@ public static TenantVariable fromDocument(Document document) {
tenantVariable.set_type(document.getString(TYPE_FIELD));
}
tenantVariable.setName(document.getString(NAME_FIELD));
tenantVariable.setStaticTenantVariableGroupId(document.getObjectId(STATIC_TENANT_VARIABLE_GROUP_ID_FIELD));

Object createdAtField = document.get(CREATED_AT_FIELD);
if (createdAtField != null) {
Expand Down Expand Up @@ -106,6 +112,7 @@ public Document toDocument() {
document.append(ID_FIELD, this.get_id());
document.append(TYPE_FIELD, this.get_type());
document.append(NAME_FIELD, this.getName());
document.append(STATIC_TENANT_VARIABLE_GROUP_ID_FIELD, this.getStaticTenantVariableGroupId());
document.append(CREATED_AT_FIELD, this.getCreatedAt());
document.append(CREATED_BY_FIELD, this.getCreatedBy());

Expand Down Expand Up @@ -142,6 +149,14 @@ public void set_type(String _type) {
this._type = _type;
}

public ObjectId getStaticTenantVariableGroupId() {
return staticTenantVariableGroupId;
}

public void setStaticTenantVariableGroupId(ObjectId staticTenantVariableGroupId) {
this.staticTenantVariableGroupId = staticTenantVariableGroupId;
}

public String getName() {
return name;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ jhipster:

application:
info:
version: 5.0.0
version: 5.0.1-SNAPSHOT
documentation:
url: https://github.com/assimbly/gateway/wiki
camel-url: https://camel.apache.org/components/latest
Expand Down

0 comments on commit 149d70d

Please sign in to comment.