Skip to content

Commit

Permalink
- database clean up and is now also in user home dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
assimbly committed Dec 16, 2020
1 parent 843c46f commit ad33d5a
Show file tree
Hide file tree
Showing 21 changed files with 128 additions and 366 deletions.
Binary file removed ${activemq.data}/kahadb/db.data
Binary file not shown.
Binary file removed ${activemq.data}/kahadb/db.redo
Binary file not shown.
Binary file removed ${activemq.data}/kahadb/lock
Binary file not shown.
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ version = '3.1.0'

description = ""

sourceCompatibility=1.8
targetCompatibility=1.8
assert System.properties["java.specification.version"] == "1.8" || "11" || "12" || "13"
sourceCompatibility=11
targetCompatibility=11
assert System.properties["java.specification.version"] == "11" || "12" || "13"

apply from: "gradle/docker.gradle"
apply from: "gradle/sonar.gradle"
Expand Down Expand Up @@ -320,11 +320,11 @@ dependencies {
// https://mvnrepository.com/artifact/org.quartz-scheduler/quartz
implementation group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.0'

implementation group: 'org.apache.activemq', name: 'artemis-core-client', version: '2.12.0'
implementation group: 'org.apache.activemq', name: 'artemis-commons', version: '2.12.0'
implementation group: 'org.apache.activemq', name: 'artemis-server', version: '2.12.0'
implementation group: 'org.apache.activemq', name: 'artemis-selector', version: '2.12.0'
implementation group: 'org.apache.activemq', name: 'artemis-journal', version: '2.12.0'
implementation group: 'org.apache.activemq', name: 'artemis-core-client', version: '2.16.0'
implementation group: 'org.apache.activemq', name: 'artemis-commons', version: '2.16.0'
implementation group: 'org.apache.activemq', name: 'artemis-server', version: '2.16.0'
implementation group: 'org.apache.activemq', name: 'artemis-selector', version: '2.16.0'
implementation group: 'org.apache.activemq', name: 'artemis-journal', version: '2.16.0'

//java 9+
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ checkstyle_version=8.29
## The setting is particularly useful for tweaking memory settings.
## Default value: -Xmx1024m -XX:MaxPermSize=256m
## un comment the below line to override the daemon defaults
org.gradle.java.home=C:/Program Files/Java/jdk1.8.0_191
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.java.home=C:/Program Files/AdoptOpenJDK/jdk-11.0.9.101-hotspot
org.gradle.jvmargs=-Xmx1524m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

## When configured, Gradle will run in incubating parallel mode.
## This option should only be used with decoupled projects. More details, visit
Expand Down
67 changes: 67 additions & 0 deletions logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>

<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml"/>

<!-- The FILE and ASYNC appenders are here as examples for a production configuration -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${user.home}/.assimbly/logs/%d{yyyy-MM-dd}.assimbly.log</fileNamePattern>
<maxHistory>90</maxHistory>
<totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>
<encoder>
<charset>utf-8</charset>
<Pattern>%d %-5level [%thread] %logger{0}: %msg%n</Pattern>
</encoder>
</appender>

<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>512</queueSize>
<appender-ref ref="FILE"/>
</appender>

<root level="${logging.level.root}">
<appender-ref ref="ASYNC"/>
</root>

<logger name="javax.activation" level="WARN"/>
<logger name="javax.mail" level="WARN"/>
<logger name="javax.management.remote" level="WARN"/>
<logger name="javax.xml.bind" level="WARN"/>
<logger name="ch.qos.logback" level="WARN"/>
<logger name="com.codahale.metrics" level="WARN"/>
<logger name="com.ryantenney" level="WARN"/>
<logger name="com.sun" level="WARN"/>
<logger name="com.zaxxer" level="WARN"/>
<logger name="io.undertow" level="WARN"/>
<logger name="io.undertow.websockets.jsr" level="ERROR"/>
<logger name="org.ehcache" level="WARN"/>
<logger name="org.apache" level="WARN"/>
<logger name="org.apache.catalina.startup.DigesterFactory" level="OFF"/>
<logger name="org.bson" level="WARN"/>
<logger name="org.hibernate.validator" level="WARN"/>
<logger name="org.hibernate" level="WARN"/>
<logger name="org.hibernate.ejb.HibernatePersistence" level="OFF"/>
<logger name="org.springframework" level="WARN"/>
<logger name="org.springframework.web" level="WARN"/>
<logger name="org.springframework.security" level="WARN"/>
<logger name="org.springframework.cache" level="WARN"/>
<logger name="org.thymeleaf" level="WARN"/>
<logger name="org.xnio" level="WARN"/>
<logger name="springfox" level="WARN"/>
<logger name="sun.rmi" level="WARN"/>
<logger name="liquibase" level="WARN"/>
<logger name="org.quartz.core.QuartzSchedulerThread" level="WARN"/>
<logger name="LiquibaseSchemaResolver" level="INFO"/>
<logger name="sun.rmi.transport" level="WARN"/>

<!-- https://logback.qos.ch/manual/configuration.html#shutdownHook and https://jira.qos.ch/browse/LOGBACK-1090 -->
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>

<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>

</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,4 @@ public void setBaseDirectory(String baseDirectory) {
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public class LoggingConfiguration {
private final String serverPort;

private final JHipsterProperties jHipsterProperties;

public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
JHipsterProperties jHipsterProperties) {

public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, JHipsterProperties jHipsterProperties) {
this.appName = appName;
this.serverPort = serverPort;
this.jHipsterProperties = jHipsterProperties;

if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
addLogstashAppender(context);
addContextListener(context);
Expand All @@ -57,6 +57,7 @@ public LoggingConfiguration(@Value("${spring.application.name}") String appName,
private void addContextListener(LoggerContext context) {
LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener();
loggerContextListener.setContext(context);

context.addListener(loggerContextListener);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Set;

import org.assimbly.gateway.domain.Flow;
import org.apache.commons.lang3.StringUtils;
import org.assimbly.docconverter.DocConverter;
import org.assimbly.gateway.domain.EnvironmentVariables;
import org.assimbly.gateway.domain.Gateway;
Expand Down Expand Up @@ -326,23 +327,21 @@ public void setXMLWireTapEndpointFromDB(WireTapEndpoint wireTapEndpointDB) throw
if (confOptionsSplitted.length > 1) {

for (String confOption : confOptionsSplitted) {
String[] confOptionSplitted = confOption.split("=");

if (confOptionSplitted.length > 0) {
Element option = doc.createElement(confOptionSplitted[0]);
option.setTextContent(confOptionSplitted[1]);
options.appendChild(option);
}
String confOptionKey = confOption.split("=")[0];
String confOptionValue = StringUtils.substringAfter(confOption, "=");

Element option = doc.createElement(confOptionKey);
option.setTextContent(confOptionValue);
options.appendChild(option);
}
} else {

String[] confOptionSplitted = confOptions.split("=");
String confOptionKey = confOptions.split("=")[0];
String confOptionValue = StringUtils.substringAfter(confOptions, "=");

if (confOptionSplitted.length > 0) {
Element option = doc.createElement(confOptionSplitted[0]);
option.setTextContent(confOptionSplitted[1]);
options.appendChild(option);
}
Element option = doc.createElement(confOptionKey);
option.setTextContent(confOptionValue);
options.appendChild(option);

}
}
Expand Down Expand Up @@ -410,13 +409,12 @@ public void setEndpointsFromDB(Set<Endpoint> endpointsDB) throws Exception {
String[] confOptionsSplitted = confOptions.split("&");

for (String confOption : confOptionsSplitted) {
String[] confOptionSplitted = confOption.split("=");

if (confOptionSplitted.length > 1) {
Element option = doc.createElement(confOptionSplitted[0]);
option.setTextContent(confOptionSplitted[1]);
options.appendChild(option);
}
String confOptionKey = confOption.split("=")[0];
String confOptionValue = StringUtils.substringAfter(confOption, "=");

Element option = doc.createElement(confOptionKey);
option.setTextContent(confOptionValue);
options.appendChild(option);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ private void init() throws Exception {
}

connectorIsStarting = true;
System.out.println("adding failureListener");
connector.addEventNotifier(failureListener);

connector.start();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spring:
indent-output: true
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:h2:file:./build/h2db/db/gateway;DB_CLOSE_DELAY=-1
url: jdbc:h2:file:${user.home}/.assimbly/db/gateway;DB_CLOSE_DELAY=-1
username: gateway
password:
hikari:
Expand Down
126 changes: 0 additions & 126 deletions src/main/resources/config/application-dev.yml.old

This file was deleted.

5 changes: 3 additions & 2 deletions src/main/resources/config/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================

logging:
logging:
level:
ROOT: INFO
org.assimbly.gateway: INFO
Expand All @@ -34,7 +34,7 @@ spring:
enabled: false
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:h2:file:./build/h2db/db/gateway;DB_CLOSE_DELAY=-1
url: jdbc:h2:file:${user.home}/.assimbly/db/gateway;DB_CLOSE_DELAY=-1
username: gateway
password:
hikari:
Expand Down Expand Up @@ -114,6 +114,7 @@ jhipster:
enabled: false
report-frequency: 60 # in seconds
logging:

logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration
enabled: false
host: localhost
Expand Down
Loading

0 comments on commit ad33d5a

Please sign in to comment.