Skip to content
Snippets Groups Projects
Commit e8da366f authored by Jan Zickermann's avatar Jan Zickermann
Browse files

OZG-7491 spring: Shutdown on done

parent c2b46ef7
Branches
Tags
1 merge request!2OZG-7491 pipeline: Change version format
Pipeline #1569 skipped
...@@ -25,6 +25,7 @@ package de.ozgcloud.eingang.xta; ...@@ -25,6 +25,7 @@ package de.ozgcloud.eingang.xta;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -43,11 +44,14 @@ class XtaRunner implements ApplicationListener<ContextRefreshedEvent> { ...@@ -43,11 +44,14 @@ class XtaRunner implements ApplicationListener<ContextRefreshedEvent> {
private XtaService service; private XtaService service;
@Autowired @Autowired
private SemantikAdapter semantikAdapter; private SemantikAdapter semantikAdapter;
@Autowired
private ConfigurableApplicationContext context;
@Override @Override
public void onApplicationEvent(ContextRefreshedEvent event) { public void onApplicationEvent(ContextRefreshedEvent event) {
LOG.info("Fetching XTA Messages"); LOG.info("Fetching XTA Messages");
runGetXtaMessages(); runGetXtaMessages();
context.close();
} }
void runGetXtaMessages() { void runGetXtaMessages() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment