Browse Source

Merge branch 'master' of http://192.168.1.220:10080/esb/esb

demon 8 years ago
parent
commit
513943c2da

+ 3 - 1
hos-arbiter/hos-arbiter.iml

@ -97,6 +97,8 @@
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: commons-net:commons-net:3.1" level="project" />
    <orderEntry type="library" name="Maven: org.jasypt:jasypt:1.9.0" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.json:json:20140107" level="project" />
    <orderEntry type="library" name="Maven: org.apache.camel:camel-core:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
@ -207,6 +209,7 @@
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.4.0" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.6" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.6" level="project" />
@ -232,7 +235,6 @@
    <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.3.0" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.json:json:20140107" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.2" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.1.9" level="project" />

+ 0 - 1
hos-arbiter/src/main/java/com/yihu/hos/arbiter/models/ServiceFlow.java

@ -15,7 +15,6 @@ public class ServiceFlow {
    private String className;
    private String path;
    private Date updateTime;
    private String cron;
    public String getCron() {

+ 17 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/BrokerServerService.java

@ -11,6 +11,9 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * @created Airhead 2016/7/27.
 */
@ -51,4 +54,18 @@ public class BrokerServerService {
    public void delete(BrokerServer brokerServer) {
        mongoOperations.remove(brokerServer);
    }
    public List<BrokerServer> get(boolean one) {
        if (one) {
            BrokerServer brokerServer = get();
            List<BrokerServer> brokerServers = new ArrayList<>();
            brokerServers.add(brokerServer);
            return brokerServers;
        }
        Query query = new Query();
        query.addCriteria(Criteria.where("enable").is(true));
        query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "updateTime")));
        return mongoOperations.find(query, BrokerServer.class);
    }
}

+ 85 - 78
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ServiceFlowService.java

@ -3,6 +3,7 @@ package com.yihu.hos.arbiter.services;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.hos.arbiter.models.BrokerServer;
import com.yihu.hos.arbiter.models.ServiceFlow;
import com.yihu.hos.core.datatype.StringUtil;
import org.apache.http.Consts;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
@ -45,13 +46,18 @@ public class ServiceFlowService {
        return null;
    }
    /**
     * Broker原则上具有等同性,这样Arbiter无论选择了哪个Broker能提供的服务都是一样的。
     * 但是因为Broker上还是会运行一些定时的采集任务,这些采集任务如果是多台Broker运行的话,可能引起数据问题。
     * 所以在事件触发时需要做一些策略的调整:
     * 1.实时任务,通知所有的Broker进行更新路由
     * 2.采集任务,只通知其中的一台进行更新路由
     * TODO:遗留BUG多Broker启动时,采集任务会在多个Broker中被启动。
     *
     * @param msg 数据流
     */
    public void trigger(String msg) {
        System.out.println(msg);
        BrokerServer brokerServer = brokerServerService.get();
        if (brokerServer == null) {
            logger.trace("can not find a valid broker server.");
            return;
        }
        ObjectMapper objectMapper = new ObjectMapper();
        try {
@ -63,87 +69,88 @@ public class ServiceFlowService {
            nameValuePairList.add(new BasicNameValuePair("path", serviceFlow.getPath()));
            nameValuePairList.add(new BasicNameValuePair("cron", serviceFlow.getCron()));
            CloseableHttpClient httpclient = HttpClients.createDefault();
            switch (serviceFlow.getEvent()) {
                case "processorAdded": {
                    HttpPost httpPost = new HttpPost(brokerServer.getURL() + "/esb/processor");
                    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                    CloseableHttpResponse response = httpclient.execute(httpPost);
                    response.close();
                    break;
                }
                case "processorDataChanged": {
                    HttpPut httpPut = new HttpPut(brokerServer.getURL() + "/esb/processor");
                    httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                    CloseableHttpResponse response = httpclient.execute(httpPut);
                    response.close();
                    break;
                }
            boolean one = !StringUtil.isEmpty(serviceFlow.getCron());   //有cron表达式,就是采集任务。
            List<BrokerServer> brokerServerList = brokerServerService.get(one);
            for (BrokerServer brokerServer : brokerServerList) {
                CloseableHttpClient httpclient = HttpClients.createDefault();
                switch (serviceFlow.getEvent()) {
                    case "processorAdded": {
                        HttpPost httpPost = new HttpPost(brokerServer.getURL() + "/esb/processor");
                        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                        CloseableHttpResponse response = httpclient.execute(httpPost);
                        response.close();
                        break;
                    }
                case "routeDefineAdded": {
                    HttpPost httpPost = new HttpPost(brokerServer.getURL() + "/esb/route");
                    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                    CloseableHttpResponse response = httpclient.execute(httpPost);
                    response.close();
                    break;
                }
                    case "processorDataChanged": {
                        HttpPut httpPut = new HttpPut(brokerServer.getURL() + "/esb/processor");
                        httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                        CloseableHttpResponse response = httpclient.execute(httpPut);
                        response.close();
                        break;
                    }
                case "routeDefineChanged": {
                    HttpPut httpPut = new HttpPut(brokerServer.getURL() + "/esb/route");
                    httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                    CloseableHttpResponse response = httpclient.execute(httpPut);
                    response.close();
                    break;
                }
                case "routeDefineDelete": {
                    try {
                        URI uri = new URIBuilder()
                                .setScheme("http")
                                .setHost(brokerServer.getHostAddress() + ":" + brokerServer.getPort())
                                .setPath("/esb/route")
                                .setParameter("serviceFlow", serviceFlow.getServiceFlow())
                                .setParameter("packageName", serviceFlow.getPackageName())
                                .setParameter("className", serviceFlow.getClassName())
                                .build();
                        HttpDelete httpDelete = new HttpDelete(uri);
                        CloseableHttpResponse response = httpclient.execute(httpDelete);
                    case "routeDefineAdded": {
                        HttpPost httpPost = new HttpPost(brokerServer.getURL() + "/esb/route");
                        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                        CloseableHttpResponse response = httpclient.execute(httpPost);
                        response.close();
                    } catch (URISyntaxException e) {
                        e.printStackTrace();
                        break;
                    }
                    case "routeDefineChanged": {
                        HttpPut httpPut = new HttpPut(brokerServer.getURL() + "/esb/route");
                        httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                        CloseableHttpResponse response = httpclient.execute(httpPut);
                        response.close();
                        break;
                    }
                    case "routeDefineDelete": {
                        try {
                            URI uri = new URIBuilder()
                                    .setScheme("http")
                                    .setHost(brokerServer.getHostAddress() + ":" + brokerServer.getPort())
                                    .setPath("/esb/route")
                                    .setParameter("serviceFlow", serviceFlow.getServiceFlow())
                                    .setParameter("packageName", serviceFlow.getPackageName())
                                    .setParameter("className", serviceFlow.getClassName())
                                    .build();
                            HttpDelete httpDelete = new HttpDelete(uri);
                            CloseableHttpResponse response = httpclient.execute(httpDelete);
                            response.close();
                        } catch (URISyntaxException e) {
                            e.printStackTrace();
                        }
                        break;
                    }
                    case "routeClassAdded": {
                        HttpPost httpPost = new HttpPost(brokerServer.getURL() + "/esb/genRoute");
                        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                        CloseableHttpResponse response = httpclient.execute(httpPost);
                        response.close();
                        break;
                    }
                    case "routeClassChanged": {
                        HttpPut httpPut = new HttpPut(brokerServer.getURL() + "/esb/updateRoute");
                        httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                        CloseableHttpResponse response = httpclient.execute(httpPut);
                        response.close();
                        break;
                    }
                    case "processorClassAdded": {
                        HttpPost httpPost = new HttpPost(brokerServer.getURL() + "/esb/genProcessor");
                        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                        CloseableHttpResponse response = httpclient.execute(httpPost);
                        response.close();
                        break;
                    }
                    break;
                    default:
                        break;
                }
                case "routeClassAdded": {
                    HttpPost httpPost = new HttpPost(brokerServer.getURL()  + "/esb/genRoute");
                    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                    CloseableHttpResponse response = httpclient.execute(httpPost);
                    response.close();
                    break;
                }
                case "routeClassChanged": {
                    HttpPut httpPut = new HttpPut(brokerServer.getURL() + "/esb/updateRoute");
                    httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                    CloseableHttpResponse response = httpclient.execute(httpPut);
                    response.close();
                    break;
                }
                case "processorClassAdded": {
                    HttpPost httpPost = new HttpPost(brokerServer.getURL()+ "/esb/genProcessor");
                    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, Consts.UTF_8));
                    CloseableHttpResponse response = httpclient.execute(httpPost);
                    response.close();
                    break;
                }
                default:
                    break;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

+ 25 - 9
hos-broker/hos-broker.iml

@ -1,5 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="web" name="Web">
      <configuration>
        <webroots>
          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
        </webroots>
        <sourceRoots>
          <root url="file://$MODULE_DIR$/src/main/java" />
          <root url="file://$MODULE_DIR$/src/main/resources" />
        </sourceRoots>
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/target/classes" />
    <output-test url="file://$MODULE_DIR$/target/test-classes" />
@ -91,6 +104,9 @@
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.3.8.RELEASE" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.2.8.RELEASE" level="project" />
    <orderEntry type="module" module-name="hos-web-framework" />
    <orderEntry type="library" name="Maven: eu.medsea.mimeutil:mime-util:2.1.3" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.4.1.RELEASE" level="project" />
@ -100,7 +116,6 @@
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.9" level="project" />
@ -125,10 +140,6 @@
    <orderEntry type="library" name="Maven: org.springframework:spring-orm:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-aspects:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.5" level="project" />
    <orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.2.4.Final" level="project" />
    <orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.1" level="project" />
@ -158,9 +169,11 @@
    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.4.1" level="project" />
    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.9.0" level="project" />
    <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.4.0" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.6" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.6" level="project" />
@ -175,6 +188,10 @@
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.4.0" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.1.9" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:html2image:0.9" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.5" level="project" />
    <orderEntry type="library" name="Maven: org.fusesource:sigar:1.6.4" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: org.apache.activemq:activemq-core:5.7.0" level="project" />
@ -187,6 +204,8 @@
    <orderEntry type="library" name="Maven: org.fusesource.hawtbuf:hawtbuf:1.9" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1" level="project" />
    <orderEntry type="library" name="Maven: org.jasypt:jasypt:1.9.0" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.json:json:20140107" level="project" />
    <orderEntry type="library" name="Maven: org.apache.camel:camel-core:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
@ -195,8 +214,6 @@
    <orderEntry type="library" name="Maven: org.apache.camel:camel-http4:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.camel:camel-http-common:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.camel:camel-jms:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-jms:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.3.3.RELEASE" level="project" />
@ -266,7 +283,6 @@
    <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.3.0" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.json:json:20140107" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.3.RELEASE" level="project" />
  </component>
</module>

+ 335 - 357
hos-broker/src/main/java/com/yihu/hos/common/appender/JMSAppender.java

@ -25,14 +25,7 @@ import org.apache.log4j.helpers.LogLog;
import org.apache.log4j.spi.ErrorCode;
import org.apache.log4j.spi.LoggingEvent;
import javax.jms.JMSException;
import javax.jms.ObjectMessage;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameNotFoundException;
@ -45,270 +38,240 @@ import java.util.Properties;
 * A simple appender that publishes events to a JMS Topic. The events
 * are serialized and transmitted as JMS message type {@link
 * ObjectMessage}.
 * <p>
 * <p>JMS {@link Topic topics} and {@link TopicConnectionFactory topic
 * connection factories} are administered objects that are retrieved
 * using JNDI messaging which in turn requires the retrieval of a JNDI
 * {@link Context}.
 * <p>
 * <p>There are two common methods for retrieving a JNDI {@link
 * Context}. If a file resource named <em>jndi.properties</em> is
 * available to the JNDI API, it will use the information found
 * therein to retrieve an initial JNDI context. To obtain an initial
 * context, your code will simply call:
   <pre>
   InitialContext jndiContext = new InitialContext();
   </pre>
 * <p>
 * <pre>
 * InitialContext jndiContext = new InitialContext();
 * </pre>
 * <p>
 * <p>Calling the no-argument <code>InitialContext()</code> method
 * will also work from within Enterprise Java Beans (EJBs) because it
 * is part of the EJB contract for application servers to provide each
 * bean an environment naming context (ENC).
 * <p>
 * <p>In the second approach, several predetermined properties are set
 * and these properties are passed to the <code>InitialContext</code>
 * constructor to connect to the naming service provider. For example,
 * to connect to JBoss naming service one would write:
<pre>
   Properties env = new Properties( );
   env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
   env.put(Context.PROVIDER_URL, "jnp://hostname:1099");
   env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
   InitialContext jndiContext = new InitialContext(env);
</pre>
   * where <em>hostname</em> is the host where the JBoss application
   * server is running.
   *
   * <p>To connect to the the naming service of Weblogic application
   * server one would write:
<pre>
   Properties env = new Properties( );
   env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
   env.put(Context.PROVIDER_URL, "t3://localhost:7001");
   InitialContext jndiContext = new InitialContext(env);
</pre>
  * <p>Other JMS providers will obviously require different values.
  *
  * The initial JNDI context can be obtained by calling the
  * no-argument <code>InitialContext()</code> method in EJBs. Only
  * clients running in a separate JVM need to be concerned about the
  * <em>jndi.properties</em> file and calling {@link
  * InitialContext#InitialContext()} or alternatively correctly
  * setting the different properties before calling {@link
  * InitialContext#InitialContext(java.util.Hashtable)} method.
   @author Ceki G&uuml;lc&uuml; */
 * <p>
 * <pre>
 * Properties env = new Properties( );
 * env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
 * env.put(Context.PROVIDER_URL, "jnp://hostname:1099");
 * env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
 * InitialContext jndiContext = new InitialContext(env);
 * </pre>
 * <p>
 * where <em>hostname</em> is the host where the JBoss application
 * server is running.
 * <p>
 * <p>To connect to the the naming service of Weblogic application
 * server one would write:
 * <p>
 * <pre>
 * Properties env = new Properties( );
 * env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
 * env.put(Context.PROVIDER_URL, "t3://localhost:7001");
 * InitialContext jndiContext = new InitialContext(env);
 * </pre>
 * <p>
 * <p>Other JMS providers will obviously require different values.
 * <p>
 * The initial JNDI context can be obtained by calling the
 * no-argument <code>InitialContext()</code> method in EJBs. Only
 * clients running in a separate JVM need to be concerned about the
 * <em>jndi.properties</em> file and calling {@link
 * InitialContext#InitialContext()} or alternatively correctly
 * setting the different properties before calling {@link
 * InitialContext#InitialContext(java.util.Hashtable)} method.
 *
 * @author Ceki G&uuml;lc&uuml;
 */
public class JMSAppender extends AppenderSkeleton {
  String securityPrincipalName;
  String securityCredentials;
  String initialContextFactoryName;
  String urlPkgPrefixes;
  String providerURL;
  String topicBindingName;
  String tcfBindingName;
  String userName;
  String password;
  boolean locationInfo;
  TopicConnection  topicConnection;
  TopicSession topicSession;
  TopicPublisher  topicPublisher;
  public
  JMSAppender() {
  }
  /**
     The <b>TopicConnectionFactoryBindingName</b> option takes a
     string value. Its value will be used to lookup the appropriate
     <code>TopicConnectionFactory</code> from the JNDI context.
   */
  public
  void setTopicConnectionFactoryBindingName(String tcfBindingName) {
    this.tcfBindingName = tcfBindingName;
  }
  /**
     Returns the value of the <b>TopicConnectionFactoryBindingName</b> option.
   */
  public
  String getTopicConnectionFactoryBindingName() {
    return tcfBindingName;
  }
  /**
     The <b>TopicBindingName</b> option takes a
     string value. Its value will be used to lookup the appropriate
     <code>Topic</code> from the JNDI context.
   */
  public
  void setTopicBindingName(String topicBindingName) {
    this.topicBindingName = topicBindingName;
  }
  /**
     Returns the value of the <b>TopicBindingName</b> option.
   */
  public
  String getTopicBindingName() {
    return topicBindingName;
  }
  /**
     Returns value of the <b>LocationInfo</b> property which
     determines whether location (stack) info is sent to the remote
     subscriber. */
  public
  boolean getLocationInfo() {
    return locationInfo;
  }
  /**
   *  Options are activated and become effective only after calling
   *  this method.*/
  public void activateOptions() {
    TopicConnectionFactory  topicConnectionFactory;
    try {
      Context jndi;
      LogLog.debug("Getting initial context.");
      if(initialContextFactoryName != null) {
	Properties env = new Properties( );
	env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactoryName);
	if(providerURL != null) {
	  env.put(Context.PROVIDER_URL, providerURL);
	} else {
	  LogLog.warn("You have set InitialContextFactoryName option but not the "
		     +"ProviderURL. This is likely to cause problems.");
	}
	if(urlPkgPrefixes != null) {
	  env.put(Context.URL_PKG_PREFIXES, urlPkgPrefixes);
	}
	if(securityPrincipalName != null) {
	  env.put(Context.SECURITY_PRINCIPAL, securityPrincipalName);
	  if(securityCredentials != null) {
	    env.put(Context.SECURITY_CREDENTIALS, securityCredentials);
	  } else {
	    LogLog.warn("You have set SecurityPrincipalName option but not the "
			+"SecurityCredentials. This is likely to cause problems.");
	  }
	}
	jndi = new InitialContext(env);
      } else {
	jndi = new InitialContext();
      }
    private String securityPrincipalName;
    private String securityCredentials;
    private String initialContextFactoryName;
    private String urlPkgPrefixes;
    private String providerURL;
    private String topicBindingName;
    private String tcfBindingName;
    private String userName;
    private String password;
    private boolean locationInfo;
    private TopicConnection topicConnection;
    private TopicSession topicSession;
    private TopicPublisher topicPublisher;
    public JMSAppender() {
    }
      LogLog.debug("Looking up ["+tcfBindingName+"]");
      topicConnectionFactory = (TopicConnectionFactory) lookup(jndi, tcfBindingName);
      LogLog.debug("About to create TopicConnection.");
      if(userName != null) {
	topicConnection = topicConnectionFactory.createTopicConnection(userName,
								       password);
      } else {
	topicConnection = topicConnectionFactory.createTopicConnection();
      }
    /**
     * Returns the value of the <b>TopicConnectionFactoryBindingName</b> option.
     */
    public String getTopicConnectionFactoryBindingName() {
        return tcfBindingName;
    }
      LogLog.debug("Creating TopicSession, non-transactional, "
		   +"in AUTO_ACKNOWLEDGE mode.");
      topicSession = topicConnection.createTopicSession(false,
							Session.AUTO_ACKNOWLEDGE);
      LogLog.debug("Looking up topic name ["+topicBindingName+"].");
      Topic topic = (Topic) lookup(jndi, topicBindingName);
      LogLog.debug("Creating TopicPublisher.");
      topicPublisher = topicSession.createPublisher(topic);
      LogLog.debug("Starting TopicConnection.");
      topicConnection.start();
      jndi.close();
    } catch(JMSException e) {
      errorHandler.error("Error while activating options for appender named ["+name+
			 "].", e, ErrorCode.GENERIC_FAILURE);
    } catch(NamingException e) {
      errorHandler.error("Error while activating options for appender named ["+name+
			 "].", e, ErrorCode.GENERIC_FAILURE);
    } catch(RuntimeException e) {
      errorHandler.error("Error while activating options for appender named ["+name+
			 "].", e, ErrorCode.GENERIC_FAILURE);
    /**
     * The <b>TopicConnectionFactoryBindingName</b> option takes a
     * string value. Its value will be used to lookup the appropriate
     * <code>TopicConnectionFactory</code> from the JNDI context.
     */
    public void setTopicConnectionFactoryBindingName(String tcfBindingName) {
        this.tcfBindingName = tcfBindingName;
    }
  }
  protected Object lookup(Context ctx, String name) throws NamingException {
    try {
      return ctx.lookup(name);
    } catch(NameNotFoundException e) {
      LogLog.error("Could not find name ["+name+"].");
      throw e;
    /**
     * Returns the value of the <b>TopicBindingName</b> option.
     */
    public String getTopicBindingName() {
        return topicBindingName;
    }
  }
  protected boolean checkEntryConditions() {
    String fail = null;
    /**
     * The <b>TopicBindingName</b> option takes a
     * string value. Its value will be used to lookup the appropriate
     * <code>Topic</code> from the JNDI context.
     */
    public void setTopicBindingName(String topicBindingName) {
        this.topicBindingName = topicBindingName;
    }
    if(this.topicConnection == null) {
      fail = "No TopicConnection";
    } else if(this.topicSession == null) {
      fail = "No TopicSession";
    } else if(this.topicPublisher == null) {
      fail = "No TopicPublisher";
    /**
     * Returns value of the <b>LocationInfo</b> property which
     * determines whether location (stack) info is sent to the remote
     * subscriber.
     */
    public boolean getLocationInfo() {
        return locationInfo;
    }
    if(fail != null) {
      errorHandler.error(fail +" for JMSAppender named ["+name+"].");
      return false;
    } else {
      return true;
    /**
     * If true, the information sent to the remote subscriber will
     * include caller's location information. By default no location
     * information is sent to the subscriber.
     */
    public void setLocationInfo(boolean locationInfo) {
        this.locationInfo = locationInfo;
    }
  }
  /**
     Close this JMSAppender. Closing releases all resources used by the
     appender. A closed appender cannot be re-opened. */
  public synchronized void close() {
    // The synchronized modifier avoids concurrent append and close operations
    /**
     * Options are activated and become effective only after calling
     * this method.
     */
    public void activateOptions() {
        TopicConnectionFactory topicConnectionFactory;
        try {
            Context jndi;
            LogLog.debug("Getting initial context.");
            if (initialContextFactoryName != null) {
                Properties env = new Properties();
                env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactoryName);
                if (providerURL != null) {
                    env.put(Context.PROVIDER_URL, providerURL);
                } else {
                    LogLog.warn("You have set InitialContextFactoryName option but not the "
                            + "ProviderURL. This is likely to cause problems.");
                }
                if (urlPkgPrefixes != null) {
                    env.put(Context.URL_PKG_PREFIXES, urlPkgPrefixes);
                }
                if (securityPrincipalName != null) {
                    env.put(Context.SECURITY_PRINCIPAL, securityPrincipalName);
                    if (securityCredentials != null) {
                        env.put(Context.SECURITY_CREDENTIALS, securityCredentials);
                    } else {
                        LogLog.warn("You have set SecurityPrincipalName option but not the "
                                + "SecurityCredentials. This is likely to cause problems.");
                    }
                }
                jndi = new InitialContext(env);
            } else {
                jndi = new InitialContext();
            }
            LogLog.debug("Looking up [" + tcfBindingName + "]");
            topicConnectionFactory = (TopicConnectionFactory) lookup(jndi, tcfBindingName);
            LogLog.debug("About to create TopicConnection.");
            if (userName != null) {
                topicConnection = topicConnectionFactory.createTopicConnection(userName,
                        password);
            } else {
                topicConnection = topicConnectionFactory.createTopicConnection();
            }
            LogLog.debug("Creating TopicSession, non-transactional, "
                    + "in AUTO_ACKNOWLEDGE mode.");
            topicSession = topicConnection.createTopicSession(false,
                    Session.AUTO_ACKNOWLEDGE);
            LogLog.debug("Looking up topic name [" + topicBindingName + "].");
            Topic topic = (Topic) lookup(jndi, topicBindingName);
            LogLog.debug("Creating TopicPublisher.");
            topicPublisher = topicSession.createPublisher(topic);
            LogLog.debug("Starting TopicConnection.");
            topicConnection.start();
            jndi.close();
        } catch (JMSException | NamingException | RuntimeException e) {
            errorHandler.error("Error while activating options for appender named [" + name +
                    "].", e, ErrorCode.GENERIC_FAILURE);
        }
    }
    if(this.closed)
      return;
    /**
     * Close this JMSAppender. Closing releases all resources used by the
     * appender. A closed appender cannot be re-opened.
     */
    public synchronized void close() {
        // The synchronized modifier avoids concurrent append and close operations
        if (this.closed)
            return;
        LogLog.debug("Closing appender [" + name + "].");
        this.closed = true;
        try {
            if (topicSession != null)
                topicSession.close();
            if (topicConnection != null)
                topicConnection.close();
        } catch (JMSException | RuntimeException e) {
            LogLog.error("Error while closing JMSAppender [" + name + "].", e);
        }
        // Help garbage collection
        topicPublisher = null;
        topicSession = null;
        topicConnection = null;
    }
    LogLog.debug("Closing appender ["+name+"].");
    this.closed = true;
    /**
     * This method called by {@link AppenderSkeleton#doAppend} method to
     * do most of the real appending work.
     */
    public void append(LoggingEvent event) {
    try {
      if(topicSession != null)
	topicSession.close();
      if(topicConnection != null)
	topicConnection.close();
    } catch(JMSException e) {
      LogLog.error("Error while closing JMSAppender ["+name+"].", e);
    } catch(RuntimeException e) {
      LogLog.error("Error while closing JMSAppender ["+name+"].", e);
    }
    // Help garbage collection
    topicPublisher = null;
    topicSession = null;
    topicConnection = null;
  }
  /**
     This method called by {@link AppenderSkeleton#doAppend} method to
     do most of the real appending work.  */
  public void append(LoggingEvent event) {
    if(!checkEntryConditions()) {
      return;
    }
        if (!checkEntryConditions()) {
            return;
        }
    try {
      if (StringUtil.isEmpty(event.getMDC("camel.messageId"))) {
@ -341,125 +304,140 @@ public class JMSAppender extends AppenderSkeleton {
        msg.setObject(JSONObject.fromObject(map).toString());
        topicPublisher.publish(msg);
      }
    } catch(JMSException e) {
      errorHandler.error("Could not publish message in JMSAppender ["+name+"].", e,
			 ErrorCode.GENERIC_FAILURE);
    } catch(RuntimeException e) {
    } catch(JMSException | RuntimeException e) {
      errorHandler.error("Could not publish message in JMSAppender ["+name+"].", e,
			 ErrorCode.GENERIC_FAILURE);
    }
  }
  /**
   * Returns the value of the <b>InitialContextFactoryName</b> option.
   * See {@link #setInitialContextFactoryName} for more details on the
   * meaning of this option.
   * */
  public String getInitialContextFactoryName() {
    return initialContextFactoryName;
  }
  public void setInitialContextFactoryName(String initialContextFactoryName) {
    this.initialContextFactoryName = initialContextFactoryName;
  }
  public String getProviderURL() {
    return providerURL;
  }
  public void setProviderURL(String providerURL) {
    this.providerURL = providerURL;
  }
  String getURLPkgPrefixes( ) {
    return urlPkgPrefixes;
  }
  public void setURLPkgPrefixes(String urlPkgPrefixes ) {
    this.urlPkgPrefixes = urlPkgPrefixes;
  }
  public String getSecurityCredentials() {
    return securityCredentials;
  }
  public void setSecurityCredentials(String securityCredentials) {
    this.securityCredentials = securityCredentials;
  }
  public String getSecurityPrincipalName() {
    return securityPrincipalName;
  }
  public void setSecurityPrincipalName(String securityPrincipalName) {
    this.securityPrincipalName = securityPrincipalName;
  }
  public String getUserName() {
    return userName;
  }
  /**
   * The user name to use when {@link
   * TopicConnectionFactory#createTopicConnection(String, String)
   * creating a topic session}.  If you set this option, you should
   * also set the <b>Password</b> option. See {@link
   * #setPassword(String)}.
   * */
  public void setUserName(String userName) {
    this.userName = userName;
  }
  public String getPassword() {
    return password;
  }
  /**
   * The paswword to use when creating a topic session.  
   */
  public void setPassword(String password) {
    this.password = password;
  }
  /**
      If true, the information sent to the remote subscriber will
      include caller's location information. By default no location
      information is sent to the subscriber.  */
  public void setLocationInfo(boolean locationInfo) {
    this.locationInfo = locationInfo;
  }
  /**
   * Returns the TopicConnection used for this appender.  Only valid after
   * activateOptions() method has been invoked.
   */
  protected TopicConnection  getTopicConnection() {
    return topicConnection;
  }
  /**
   * Returns the TopicSession used for this appender.  Only valid after
   * activateOptions() method has been invoked.
   */
  protected TopicSession  getTopicSession() {
    return topicSession;
  }
  /**
   * Returns the TopicPublisher used for this appender.  Only valid after
   * activateOptions() method has been invoked.
   */
  protected TopicPublisher  getTopicPublisher() {
    return topicPublisher;
  }
  /**
   * The JMSAppender sends serialized events and consequently does not
   * require a layout.
   */
  public boolean requiresLayout() {
    return false;
  }
    }
    /**
     * Returns the value of the <b>InitialContextFactoryName</b> option.
     * See {@link #setInitialContextFactoryName} for more details on the
     * meaning of this option.
     */
    public String getInitialContextFactoryName() {
        return initialContextFactoryName;
    }
    public void setInitialContextFactoryName(String initialContextFactoryName) {
        this.initialContextFactoryName = initialContextFactoryName;
    }
    public String getProviderURL() {
        return providerURL;
    }
    public void setProviderURL(String providerURL) {
        this.providerURL = providerURL;
    }
    public String getSecurityCredentials() {
        return securityCredentials;
    }
    public void setSecurityCredentials(String securityCredentials) {
        this.securityCredentials = securityCredentials;
    }
    public String getSecurityPrincipalName() {
        return securityPrincipalName;
    }
    public void setSecurityPrincipalName(String securityPrincipalName) {
        this.securityPrincipalName = securityPrincipalName;
    }
    public String getUserName() {
        return userName;
    }
    /**
     * The user name to use when {@link
     * TopicConnectionFactory#createTopicConnection(String, String)
     * creating a topic session}.  If you set this option, you should
     * also set the <b>Password</b> option. See {@link
     * #setPassword(String)}.
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getPassword() {
        return password;
    }
    /**
     * The paswword to use when creating a topic session.
     */
    public void setPassword(String password) {
        this.password = password;
    }
    /**
     * The JMSAppender sends serialized events and consequently does not
     * require a layout.
     */
    public boolean requiresLayout() {
        return false;
    }
    protected Object lookup(Context ctx, String name) throws NamingException {
        try {
            return ctx.lookup(name);
        } catch (NameNotFoundException e) {
            LogLog.error("Could not find name [" + name + "].");
            throw e;
        }
    }
    protected boolean checkEntryConditions() {
        String fail = null;
        if (this.topicConnection == null) {
            fail = "No TopicConnection";
        } else if (this.topicSession == null) {
            fail = "No TopicSession";
        } else if (this.topicPublisher == null) {
            fail = "No TopicPublisher";
        }
        if (fail != null) {
            errorHandler.error(fail + " for JMSAppender named [" + name + "].");
            return false;
        } else {
            return true;
        }
    }
    /**
     * Returns the TopicConnection used for this appender.  Only valid after
     * activateOptions() method has been invoked.
     */
    protected TopicConnection getTopicConnection() {
        return topicConnection;
    }
    /**
     * Returns the TopicSession used for this appender.  Only valid after
     * activateOptions() method has been invoked.
     */
    protected TopicSession getTopicSession() {
        return topicSession;
    }
    /**
     * Returns the TopicPublisher used for this appender.  Only valid after
     * activateOptions() method has been invoked.
     */
    protected TopicPublisher getTopicPublisher() {
        return topicPublisher;
    }
    String getURLPkgPrefixes() {
        return urlPkgPrefixes;
    }
    public void setURLPkgPrefixes(String urlPkgPrefixes) {
        this.urlPkgPrefixes = urlPkgPrefixes;
    }
}

+ 4 - 0
hos-core/hos-core.iml

@ -29,5 +29,9 @@
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.4.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.4.1" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.1" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.3.RELEASE" level="project" />
  </component>
</module>

+ 6 - 4
hos-rest/hos-rest.iml

@ -83,6 +83,9 @@
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.3.8.RELEASE" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.2.8.RELEASE" level="project" />
    <orderEntry type="module" module-name="hos-web-framework" />
    <orderEntry type="library" name="Maven: eu.medsea.mimeutil:mime-util:2.1.3" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.4.1.RELEASE" level="project" />
@ -113,7 +116,6 @@
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-mongodb:1.9.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.12.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.2.2" level="project" />
    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.37" level="project" />
    <orderEntry type="library" name="Maven: com.oracle:ojdbc6:11.2.0.3.0" level="project" />
@ -130,9 +132,11 @@
    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.4.1" level="project" />
    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.9.0" level="project" />
    <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.4.0" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.6" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.6" level="project" />
@ -172,8 +176,6 @@
    <orderEntry type="library" name="Maven: org.apache.camel:camel-http4:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.camel:camel-http-common:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.camel:camel-jms:2.17.1" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-jms:4.3.3.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.3.3.RELEASE" level="project" />

+ 3 - 0
hos-web-framework-dependencies/hos-web-framework-dependencies.iml

@ -127,6 +127,9 @@
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.4.0" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.6" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.6" level="project" />

+ 6 - 2
hos-web-framework/hos-web-framework.iml

@ -89,6 +89,9 @@
    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:4.2.8.RELEASE" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.3.8.RELEASE" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.2.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: eu.medsea.mimeutil:mime-util:2.1.3" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.4.1.RELEASE" level="project" />
@ -101,7 +104,6 @@
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:1.4.1.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.7" level="project" />
    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.7" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.21" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.21" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
@ -161,9 +163,11 @@
    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.4.1" level="project" />
    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.9.0" level="project" />
    <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.4.0" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.6" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.6" level="project" />

+ 4 - 0
src/main/resources/application.yml

@ -97,6 +97,10 @@ upload:
    path: /usr/local/esb/file/webapps/ROOT/
  server:
    path: http://172.19.103.89:8081/
esb:
  genCamelUrl: http://127.0.0.1:8099/esb/genCamelFile
  camelFile: D:\camel-class\
---
spring:
  profiles: hzy