Combined Spring Boot integration & web application won't start -
i have created 2 spring boot applications. 1 uses spring integration read stuff several feeds , other combines retrieved data feeds on simple web page.
currently these 2 exist separate apps want combine 2 in single application. integration "application" nothing more integration.xml , other 1 couple of restcontrollers.
in application class integration application has following in main method:
configurableapplicationcontext ctx = new springapplication("/feed/integration.xml").run(args); system.out.println("hit enter terminate"); final int read = system.in.read(); system.out.println("closing! (" + read + ")"); ctx.close();
the web application has
springapplication.run(mywebapplication.class, args);
i've tried combine 2 resulting in:
try { configurableapplicationcontext ctx = new springapplication("/feed/integration.xml").run(trailerlistapplication.class, args); system.out.println("hit enter terminate"); system.in.read(); ctx.close(); } catch (ioexception e) { e.printstacktrace(); }
but starts web application. feeds don't initialized. how can make sure both components start , keep running?
add @importresource("classpath:/feed/integration.xml")
mywebapplication
, use
springapplication.run(mywebapplication.class, args);
Comments
Post a Comment