Browse Source

获取数据的代码编写

gxt_xa_000000 4 years ago
parent
commit
d78d764a8d

+ 6 - 5
.mvn/wrapper/MavenWrapperDownloader.java

@@ -13,6 +13,7 @@
13
  * See the License for the specific language governing permissions and
13
  * See the License for the specific language governing permissions and
14
  * limitations under the License.
14
  * limitations under the License.
15
  */
15
  */
16
+
16
 import java.net.*;
17
 import java.net.*;
17
 import java.io.*;
18
 import java.io.*;
18
 import java.nio.channels.*;
19
 import java.nio.channels.*;
@@ -25,7 +26,7 @@ public class MavenWrapperDownloader {
25
      * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26
      * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26
      */
27
      */
27
     private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28
     private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28
-        + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29
 
30
 
30
     /**
31
     /**
31
      * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32
      * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
@@ -54,7 +55,7 @@ public class MavenWrapperDownloader {
54
         // wrapperUrl parameter.
55
         // wrapperUrl parameter.
55
         File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56
         File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56
         String url = DEFAULT_DOWNLOAD_URL;
57
         String url = DEFAULT_DOWNLOAD_URL;
57
-        if(mavenWrapperPropertyFile.exists()) {
58
+        if (mavenWrapperPropertyFile.exists()) {
58
             FileInputStream mavenWrapperPropertyFileInputStream = null;
59
             FileInputStream mavenWrapperPropertyFileInputStream = null;
59
             try {
60
             try {
60
                 mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61
                 mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
@@ -65,7 +66,7 @@ public class MavenWrapperDownloader {
65
                 System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66
                 System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66
             } finally {
67
             } finally {
67
                 try {
68
                 try {
68
-                    if(mavenWrapperPropertyFileInputStream != null) {
69
+                    if (mavenWrapperPropertyFileInputStream != null) {
69
                         mavenWrapperPropertyFileInputStream.close();
70
                         mavenWrapperPropertyFileInputStream.close();
70
                     }
71
                     }
71
                 } catch (IOException e) {
72
                 } catch (IOException e) {
@@ -76,8 +77,8 @@ public class MavenWrapperDownloader {
76
         System.out.println("- Downloading from: " + url);
77
         System.out.println("- Downloading from: " + url);
77
 
78
 
78
         File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79
         File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79
-        if(!outputFile.getParentFile().exists()) {
80
-            if(!outputFile.getParentFile().mkdirs()) {
80
+        if (!outputFile.getParentFile().exists()) {
81
+            if (!outputFile.getParentFile().mkdirs()) {
81
                 System.out.println(
82
                 System.out.println(
82
                         "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83
                         "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83
             }
84
             }

+ 41 - 6
pom.xml

@@ -1,7 +1,7 @@
1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <project xmlns="http://maven.apache.org/POM/4.0.0"
2
 <project xmlns="http://maven.apache.org/POM/4.0.0"
3
-		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
     <modelVersion>4.0.0</modelVersion>
5
     <modelVersion>4.0.0</modelVersion>
6
     <parent>
6
     <parent>
7
         <groupId>org.springframework.boot</groupId>
7
         <groupId>org.springframework.boot</groupId>
@@ -50,10 +50,10 @@
50
             <groupId>org.springframework.boot</groupId>
50
             <groupId>org.springframework.boot</groupId>
51
             <artifactId>spring-boot-starter-jdbc</artifactId>
51
             <artifactId>spring-boot-starter-jdbc</artifactId>
52
         </dependency>
52
         </dependency>
53
-       <!-- <dependency>
54
-            <groupId>com.zaxxer</groupId>
55
-            <artifactId>HikariCP</artifactId>
56
-        </dependency>-->
53
+        <!-- <dependency>
54
+             <groupId>com.zaxxer</groupId>
55
+             <artifactId>HikariCP</artifactId>
56
+         </dependency>-->
57
         <dependency>
57
         <dependency>
58
             <groupId>org.springframework.boot</groupId>
58
             <groupId>org.springframework.boot</groupId>
59
             <artifactId>spring-boot-starter-activemq</artifactId>
59
             <artifactId>spring-boot-starter-activemq</artifactId>
@@ -64,6 +64,10 @@
64
         </dependency>
64
         </dependency>
65
         <dependency>
65
         <dependency>
66
             <groupId>org.apache.camel.springboot</groupId>
66
             <groupId>org.apache.camel.springboot</groupId>
67
+            <artifactId>camel-rest-starter</artifactId>
68
+        </dependency>
69
+        <dependency>
70
+            <groupId>org.apache.camel.springboot</groupId>
67
             <artifactId>camel-spring-boot-starter</artifactId>
71
             <artifactId>camel-spring-boot-starter</artifactId>
68
         </dependency>
72
         </dependency>
69
         <dependency>
73
         <dependency>
@@ -84,6 +88,10 @@
84
         </dependency>
88
         </dependency>
85
         <dependency>
89
         <dependency>
86
             <groupId>org.apache.camel.springboot</groupId>
90
             <groupId>org.apache.camel.springboot</groupId>
91
+            <artifactId>camel-rest-starter</artifactId>
92
+        </dependency>
93
+        <dependency>
94
+            <groupId>org.apache.camel.springboot</groupId>
87
             <artifactId>camel-file-starter</artifactId>
95
             <artifactId>camel-file-starter</artifactId>
88
         </dependency>
96
         </dependency>
89
         <dependency>
97
         <dependency>
@@ -96,6 +104,28 @@
96
             <optional>true</optional>
104
             <optional>true</optional>
97
         </dependency>
105
         </dependency>
98
         <dependency>
106
         <dependency>
107
+            <groupId>org.apache.camel</groupId>
108
+            <artifactId>camel-http</artifactId>
109
+        </dependency>
110
+
111
+        <dependency>
112
+            <groupId>com.fasterxml.jackson.core</groupId>
113
+            <artifactId>jackson-core</artifactId>
114
+            <version>2.12.3</version>
115
+        </dependency>
116
+        <dependency>
117
+            <groupId>org.apache.camel</groupId>
118
+            <artifactId>camel-jackson</artifactId>
119
+        </dependency>
120
+        <dependency>
121
+            <groupId>org.apache.camel</groupId>
122
+            <artifactId>camel-jetty</artifactId>
123
+        </dependency>
124
+        <dependency>
125
+            <groupId>org.apache.camel</groupId>
126
+            <artifactId>camel-servlet</artifactId>
127
+        </dependency>
128
+        <dependency>
99
             <groupId>org.springframework.boot</groupId>
129
             <groupId>org.springframework.boot</groupId>
100
             <artifactId>spring-boot-starter-test</artifactId>
130
             <artifactId>spring-boot-starter-test</artifactId>
101
             <scope>test</scope>
131
             <scope>test</scope>
@@ -111,6 +141,11 @@
111
             <artifactId>spring-integration-test</artifactId>
141
             <artifactId>spring-integration-test</artifactId>
112
             <scope>test</scope>
142
             <scope>test</scope>
113
         </dependency>
143
         </dependency>
144
+        <dependency>
145
+            <groupId>com.alibaba</groupId>
146
+            <artifactId>fastjson</artifactId>
147
+            <version>1.2.69</version>
148
+        </dependency>
114
     </dependencies>
149
     </dependencies>
115
 
150
 
116
 
151
 

+ 272 - 272
settings.xml

@@ -46,297 +46,297 @@ under the License.
46
 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
46
 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
47
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
47
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
48
           xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
48
           xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
49
-  <!-- localRepository
50
-   | The path to the local repository maven will use to store artifacts.
51
-   |
52
-   | Default: ${user.home}/.m2/repository
53
-  <localRepository>/path/to/local/repo</localRepository>
54
-  -->
55
-  <localRepository>D:/repository</localRepository>
56
-
57
-  <!-- interactiveMode
58
-   | This will determine whether maven prompts you when it needs input. If set to false,
59
-   | maven will use a sensible default value, perhaps based on some other setting, for
60
-   | the parameter in question.
61
-   |
62
-   | Default: true
63
-  <interactiveMode>true</interactiveMode>
64
-  -->
65
-
66
-  <!-- offline
67
-   | Determines whether maven should attempt to connect to the network when executing a build.
68
-   | This will have an effect on artifact downloads, artifact deployment, and others.
69
-   |
70
-   | Default: false
71
-  <offline>false</offline>
72
-  -->
73
-
74
-  <!-- pluginGroups
75
-   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
76
-   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
77
-   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
78
-   |-->
79
-  <pluginGroups>
80
-    <!-- pluginGroup
81
-     | Specifies a further group identifier to use for plugin lookup.
82
-    <pluginGroup>com.your.plugins</pluginGroup>
49
+    <!-- localRepository
50
+     | The path to the local repository maven will use to store artifacts.
51
+     |
52
+     | Default: ${user.home}/.m2/repository
53
+    <localRepository>/path/to/local/repo</localRepository>
83
     -->
54
     -->
84
-  </pluginGroups>
55
+    <localRepository>D:/repository</localRepository>
85
 
56
 
86
-  <!-- proxies
87
-   | This is a list of proxies which can be used on this machine to connect to the network.
88
-   | Unless otherwise specified (by system property or command-line switch), the first proxy
89
-   | specification in this list marked as active will be used.
90
-   |-->
91
-  <proxies>
92
-    <!-- proxy
93
-     | Specification for one proxy, to be used in connecting to the network.
57
+    <!-- interactiveMode
58
+     | This will determine whether maven prompts you when it needs input. If set to false,
59
+     | maven will use a sensible default value, perhaps based on some other setting, for
60
+     | the parameter in question.
94
      |
61
      |
95
-    <proxy>
96
-      <id>optional</id>
97
-      <active>true</active>
98
-      <protocol>http</protocol>
99
-      <username>proxyuser</username>
100
-      <password>proxypass</password>
101
-      <host>proxy.host.net</host>
102
-      <port>80</port>
103
-      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
104
-    </proxy>
62
+     | Default: true
63
+    <interactiveMode>true</interactiveMode>
105
     -->
64
     -->
106
-  </proxies>
107
 
65
 
108
-  <!-- servers
109
-   | This is a list of authentication profiles, keyed by the server-id used within the system.
110
-   | Authentication profiles can be used whenever maven must make a connection to a remote server.
111
-   |-->
112
-  <servers>
113
-    <!-- server
114
-     | Specifies the authentication information to use when connecting to a particular server, identified by
115
-     | a unique name within the system (referred to by the 'id' attribute below).
116
-     |
117
-     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
118
-     |       used together.
66
+    <!-- offline
67
+     | Determines whether maven should attempt to connect to the network when executing a build.
68
+     | This will have an effect on artifact downloads, artifact deployment, and others.
119
      |
69
      |
120
-    <server>
121
-      <id>deploymentRepo</id>
122
-      <username>repouser</username>
123
-      <password>repopwd</password>
124
-    </server>
70
+     | Default: false
71
+    <offline>false</offline>
125
     -->
72
     -->
126
 
73
 
127
-    <!-- Another sample, using keys to authenticate.
128
-    <server>
129
-      <id>siteServer</id>
130
-      <privateKey>/path/to/private/key</privateKey>
131
-      <passphrase>optional; leave empty if not used.</passphrase>
132
-    </server>
133
-    -->
134
-	<server>   
135
-		<id>releases</id>   
136
-		<username>admin</username>   
137
-		<password>123456</password>   
138
-	</server>
139
-	<server>   
140
-		<id>snapshots</id>   
141
-		<username>admin</username>   
142
-		<password>123456</password>   
143
-	</server>
144
-  </servers>
74
+    <!-- pluginGroups
75
+     | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
76
+     | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
77
+     | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
78
+     |-->
79
+    <pluginGroups>
80
+        <!-- pluginGroup
81
+         | Specifies a further group identifier to use for plugin lookup.
82
+        <pluginGroup>com.your.plugins</pluginGroup>
83
+        -->
84
+    </pluginGroups>
145
 
85
 
146
-  <!-- mirrors
147
-   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
148
-   |
149
-   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
150
-   | However, this repository may have problems with heavy traffic at times, so people have mirrored
151
-   | it to several places.
152
-   |
153
-   | That repository definition will have a unique id, so we can create a mirror reference for that
154
-   | repository, to be used as an alternate download site. The mirror site will be the preferred
155
-   | server for that repository.
156
-   |-->
157
-  <mirrors>
158
-    <!-- mirror
159
-     | Specifies a repository mirror site to use instead of a given repository. The repository that
160
-     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
161
-     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
162
-     |
163
-    <mirror>
164
-      <id>mirrorId</id>
165
-      <mirrorOf>repositoryId</mirrorOf>
166
-      <name>Human Readable Name for this Mirror.</name>
167
-      <url>http://my.repository.com/repo/path</url>
168
-    </mirror>
169
-	
170
-	 <mirror>
171
-	  <id>aliyunmaven</id>
172
-	  <mirrorOf>*</mirrorOf>
173
-	  <name>阿里云公共仓库</name>
174
-	  <url>https://maven.aliyun.com/repository/public</url>
175
-	</mirror>
176
-	
177
-     -->
178
-	<mirror>
179
-		<id>nexus</id>
180
-		<name>maven-public</name>
181
-		<url>http://117.34.118.57:28081/repository/maven-public/</url>
182
-		<mirrorOf>*</mirrorOf>
183
-	</mirror>
184
-	
185
-  </mirrors>
86
+    <!-- proxies
87
+     | This is a list of proxies which can be used on this machine to connect to the network.
88
+     | Unless otherwise specified (by system property or command-line switch), the first proxy
89
+     | specification in this list marked as active will be used.
90
+     |-->
91
+    <proxies>
92
+        <!-- proxy
93
+         | Specification for one proxy, to be used in connecting to the network.
94
+         |
95
+        <proxy>
96
+          <id>optional</id>
97
+          <active>true</active>
98
+          <protocol>http</protocol>
99
+          <username>proxyuser</username>
100
+          <password>proxypass</password>
101
+          <host>proxy.host.net</host>
102
+          <port>80</port>
103
+          <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
104
+        </proxy>
105
+        -->
106
+    </proxies>
107
+
108
+    <!-- servers
109
+     | This is a list of authentication profiles, keyed by the server-id used within the system.
110
+     | Authentication profiles can be used whenever maven must make a connection to a remote server.
111
+     |-->
112
+    <servers>
113
+        <!-- server
114
+         | Specifies the authentication information to use when connecting to a particular server, identified by
115
+         | a unique name within the system (referred to by the 'id' attribute below).
116
+         |
117
+         | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
118
+         |       used together.
119
+         |
120
+        <server>
121
+          <id>deploymentRepo</id>
122
+          <username>repouser</username>
123
+          <password>repopwd</password>
124
+        </server>
125
+        -->
126
+
127
+        <!-- Another sample, using keys to authenticate.
128
+        <server>
129
+          <id>siteServer</id>
130
+          <privateKey>/path/to/private/key</privateKey>
131
+          <passphrase>optional; leave empty if not used.</passphrase>
132
+        </server>
133
+        -->
134
+        <server>
135
+            <id>releases</id>
136
+            <username>admin</username>
137
+            <password>123456</password>
138
+        </server>
139
+        <server>
140
+            <id>snapshots</id>
141
+            <username>admin</username>
142
+            <password>123456</password>
143
+        </server>
144
+    </servers>
186
 
145
 
187
-  <!-- profiles
188
-   | This is a list of profiles which can be activated in a variety of ways, and which can modify
189
-   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
190
-   | specific paths and repository locations which allow the build to work in the local environment.
191
-   |
192
-   | For example, if you have an integration testing plugin - like cactus - that needs to know where
193
-   | your Tomcat instance is installed, you can provide a variable here such that the variable is
194
-   | dereferenced during the build process to configure the cactus plugin.
195
-   |
196
-   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
197
-   | section of this document (settings.xml) - will be discussed later. Another way essentially
198
-   | relies on the detection of a system property, either matching a particular value for the property,
199
-   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
200
-   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
201
-   | Finally, the list of active profiles can be specified directly from the command line.
202
-   |
203
-   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
204
-   |       repositories, plugin repositories, and free-form properties to be used as configuration
205
-   |       variables for plugins in the POM.
206
-   |
207
-   |-->
208
-  <profiles>
209
-    <!-- profile
210
-     | Specifies a set of introductions to the build process, to be activated using one or more of the
211
-     | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
212
-     | or the command line, profiles have to have an ID that is unique.
146
+    <!-- mirrors
147
+     | This is a list of mirrors to be used in downloading artifacts from remote repositories.
213
      |
148
      |
214
-     | An encouraged best practice for profile identification is to use a consistent naming convention
215
-     | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
216
-     | This will make it more intuitive to understand what the set of introduced profiles is attempting
217
-     | to accomplish, particularly when you only have a list of profile id's for debug.
149
+     | It works like this: a POM may declare a repository to use in resolving certain artifacts.
150
+     | However, this repository may have problems with heavy traffic at times, so people have mirrored
151
+     | it to several places.
218
      |
152
      |
219
-     | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
220
-    <profile>
221
-      <id>jdk-1.4</id>
153
+     | That repository definition will have a unique id, so we can create a mirror reference for that
154
+     | repository, to be used as an alternate download site. The mirror site will be the preferred
155
+     | server for that repository.
156
+     |-->
157
+    <mirrors>
158
+        <!-- mirror
159
+         | Specifies a repository mirror site to use instead of a given repository. The repository that
160
+         | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
161
+         | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
162
+         |
163
+        <mirror>
164
+          <id>mirrorId</id>
165
+          <mirrorOf>repositoryId</mirrorOf>
166
+          <name>Human Readable Name for this Mirror.</name>
167
+          <url>http://my.repository.com/repo/path</url>
168
+        </mirror>
222
 
169
 
223
-      <activation>
224
-        <jdk>1.4</jdk>
225
-      </activation>
170
+         <mirror>
171
+          <id>aliyunmaven</id>
172
+          <mirrorOf>*</mirrorOf>
173
+          <name>阿里云公共仓库</name>
174
+          <url>https://maven.aliyun.com/repository/public</url>
175
+        </mirror>
226
 
176
 
227
-      <repositories>
228
-        <repository>
229
-          <id>jdk14</id>
230
-          <name>Repository for JDK 1.4 builds</name>
231
-          <url>http://www.myhost.com/maven/jdk14</url>
232
-          <layout>default</layout>
233
-          <snapshotPolicy>always</snapshotPolicy>
234
-        </repository>
235
-      </repositories>
236
-    </profile>
237
-    -->
238
-<profile>
239
-      <activation>
240
-          <!-- 默认激活此 profile -->
241
-          <activeByDefault>true</activeByDefault>
242
-      </activation>
243
-      <repositories>
244
-        <repository>
245
-          <id>nexus</id>
246
-          <name>Nexus Repository</name>
247
-          <url>http://117.34.118.57:28081/repository/maven-public/</url>
248
-          <releases>
249
-            <enabled>true</enabled>
250
-          </releases>
251
-        </repository>
252
-      
253
-        <repository>
254
-          <id>central</id>
255
-          <name>Nexus Central Repository</name>
256
-          <url>http://117.34.118.57:28081/repository/maven-central/</url>
257
-          <releases>
258
-            <enabled>true</enabled>
259
-          </releases>
260
-          <snapshots>
261
-            <enabled>false</enabled>
262
-          </snapshots>
263
-        </repository>
264
-        
265
-        <repository>
266
-          <id>release</id>
267
-          <name>Nexus Release Repository</name>
268
-          <url>http://117.34.118.57:28081/repository/maven-releases/</url>
269
-          <releases>
270
-            <enabled>true</enabled>
271
-          </releases>
272
-          <snapshots>
273
-            <enabled>false</enabled>
274
-          </snapshots>
275
-        </repository>
276
-        
277
-        <repository>
278
-          <id>snapshots</id>
279
-          <name>Nexus Snapshots Repository</name>
280
-          <url>http://117.34.118.57:28081/repository/maven-snapshots/</url>
281
-          <releases>
282
-            <enabled>true</enabled>
283
-          </releases>
284
-          <snapshots>
285
-            <enabled>true</enabled>
286
-          </snapshots>
287
-        </repository>
288
-      </repositories>
289
-      
290
-      <pluginRepositories>
291
-        <pluginRepository>
292
-          <id>plugins</id>
293
-          <name>Nexus Plugin Repositories</name>
294
-          <url>http://117.34.118.57:28081/repository/maven-public/</url>
295
-        </pluginRepository>
296
-      </pluginRepositories>
297
-    </profile>
298
-    <!--
299
-     | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
300
-     | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
301
-     | might hypothetically look like:
177
+         -->
178
+        <mirror>
179
+            <id>nexus</id>
180
+            <name>maven-public</name>
181
+            <url>http://117.34.118.57:28081/repository/maven-public/</url>
182
+            <mirrorOf>*</mirrorOf>
183
+        </mirror>
184
+
185
+    </mirrors>
186
+
187
+    <!-- profiles
188
+     | This is a list of profiles which can be activated in a variety of ways, and which can modify
189
+     | the build process. Profiles provided in the settings.xml are intended to provide local machine-
190
+     | specific paths and repository locations which allow the build to work in the local environment.
302
      |
191
      |
303
-     | ...
304
-     | <plugin>
305
-     |   <groupId>org.myco.myplugins</groupId>
306
-     |   <artifactId>myplugin</artifactId>
192
+     | For example, if you have an integration testing plugin - like cactus - that needs to know where
193
+     | your Tomcat instance is installed, you can provide a variable here such that the variable is
194
+     | dereferenced during the build process to configure the cactus plugin.
307
      |
195
      |
308
-     |   <configuration>
309
-     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
310
-     |   </configuration>
311
-     | </plugin>
312
-     | ...
196
+     | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
197
+     | section of this document (settings.xml) - will be discussed later. Another way essentially
198
+     | relies on the detection of a system property, either matching a particular value for the property,
199
+     | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
200
+     | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
201
+     | Finally, the list of active profiles can be specified directly from the command line.
313
      |
202
      |
314
-     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
315
-     |       anything, you could just leave off the <value/> inside the activation-property.
203
+     | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
204
+     |       repositories, plugin repositories, and free-form properties to be used as configuration
205
+     |       variables for plugins in the POM.
316
      |
206
      |
317
-    <profile>
318
-      <id>env-dev</id>
207
+     |-->
208
+    <profiles>
209
+        <!-- profile
210
+         | Specifies a set of introductions to the build process, to be activated using one or more of the
211
+         | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
212
+         | or the command line, profiles have to have an ID that is unique.
213
+         |
214
+         | An encouraged best practice for profile identification is to use a consistent naming convention
215
+         | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
216
+         | This will make it more intuitive to understand what the set of introduced profiles is attempting
217
+         | to accomplish, particularly when you only have a list of profile id's for debug.
218
+         |
219
+         | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
220
+        <profile>
221
+          <id>jdk-1.4</id>
319
 
222
 
320
-      <activation>
321
-        <property>
322
-          <name>target-env</name>
323
-          <value>dev</value>
324
-        </property>
325
-      </activation>
223
+          <activation>
224
+            <jdk>1.4</jdk>
225
+          </activation>
326
 
226
 
327
-      <properties>
328
-        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
329
-      </properties>
330
-    </profile>
331
-    -->
332
-  </profiles>
227
+          <repositories>
228
+            <repository>
229
+              <id>jdk14</id>
230
+              <name>Repository for JDK 1.4 builds</name>
231
+              <url>http://www.myhost.com/maven/jdk14</url>
232
+              <layout>default</layout>
233
+              <snapshotPolicy>always</snapshotPolicy>
234
+            </repository>
235
+          </repositories>
236
+        </profile>
237
+        -->
238
+        <profile>
239
+            <activation>
240
+                <!-- 默认激活此 profile -->
241
+                <activeByDefault>true</activeByDefault>
242
+            </activation>
243
+            <repositories>
244
+                <repository>
245
+                    <id>nexus</id>
246
+                    <name>Nexus Repository</name>
247
+                    <url>http://117.34.118.57:28081/repository/maven-public/</url>
248
+                    <releases>
249
+                        <enabled>true</enabled>
250
+                    </releases>
251
+                </repository>
252
+
253
+                <repository>
254
+                    <id>central</id>
255
+                    <name>Nexus Central Repository</name>
256
+                    <url>http://117.34.118.57:28081/repository/maven-central/</url>
257
+                    <releases>
258
+                        <enabled>true</enabled>
259
+                    </releases>
260
+                    <snapshots>
261
+                        <enabled>false</enabled>
262
+                    </snapshots>
263
+                </repository>
264
+
265
+                <repository>
266
+                    <id>release</id>
267
+                    <name>Nexus Release Repository</name>
268
+                    <url>http://117.34.118.57:28081/repository/maven-releases/</url>
269
+                    <releases>
270
+                        <enabled>true</enabled>
271
+                    </releases>
272
+                    <snapshots>
273
+                        <enabled>false</enabled>
274
+                    </snapshots>
275
+                </repository>
276
+
277
+                <repository>
278
+                    <id>snapshots</id>
279
+                    <name>Nexus Snapshots Repository</name>
280
+                    <url>http://117.34.118.57:28081/repository/maven-snapshots/</url>
281
+                    <releases>
282
+                        <enabled>true</enabled>
283
+                    </releases>
284
+                    <snapshots>
285
+                        <enabled>true</enabled>
286
+                    </snapshots>
287
+                </repository>
288
+            </repositories>
333
 
289
 
334
-  <!-- activeProfiles
335
-   | List of profiles that are active for all builds.
336
-   |
337
-  <activeProfiles>
338
-    <activeProfile>alwaysActiveProfile</activeProfile>
339
-    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
340
-  </activeProfiles>
341
-  -->
290
+            <pluginRepositories>
291
+                <pluginRepository>
292
+                    <id>plugins</id>
293
+                    <name>Nexus Plugin Repositories</name>
294
+                    <url>http://117.34.118.57:28081/repository/maven-public/</url>
295
+                </pluginRepository>
296
+            </pluginRepositories>
297
+        </profile>
298
+        <!--
299
+         | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
300
+         | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
301
+         | might hypothetically look like:
302
+         |
303
+         | ...
304
+         | <plugin>
305
+         |   <groupId>org.myco.myplugins</groupId>
306
+         |   <artifactId>myplugin</artifactId>
307
+         |
308
+         |   <configuration>
309
+         |     <tomcatLocation>${tomcatPath}</tomcatLocation>
310
+         |   </configuration>
311
+         | </plugin>
312
+         | ...
313
+         |
314
+         | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
315
+         |       anything, you could just leave off the <value/> inside the activation-property.
316
+         |
317
+        <profile>
318
+          <id>env-dev</id>
319
+
320
+          <activation>
321
+            <property>
322
+              <name>target-env</name>
323
+              <value>dev</value>
324
+            </property>
325
+          </activation>
326
+
327
+          <properties>
328
+            <tomcatPath>/path/to/tomcat/instance</tomcatPath>
329
+          </properties>
330
+        </profile>
331
+        -->
332
+    </profiles>
333
+
334
+    <!-- activeProfiles
335
+     | List of profiles that are active for all builds.
336
+     |
337
+    <activeProfiles>
338
+      <activeProfile>alwaysActiveProfile</activeProfile>
339
+      <activeProfile>anotherAlwaysActiveProfile</activeProfile>
340
+    </activeProfiles>
341
+    -->
342
 </settings>
342
 </settings>

+ 3 - 0
src/main/java/com/gct/tools/etlcamelhuge/EtlCamelHugeApplication.java

@@ -1,8 +1,11 @@
1
 package com.gct.tools.etlcamelhuge;
1
 package com.gct.tools.etlcamelhuge;
2
 
2
 
3
+import org.apache.camel.component.servlet.CamelHttpTransportServlet;
3
 import org.springframework.boot.SpringApplication;
4
 import org.springframework.boot.SpringApplication;
4
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5
 import org.springframework.boot.autoconfigure.SpringBootApplication;
6
 import org.springframework.boot.autoconfigure.SpringBootApplication;
7
+import org.springframework.boot.web.servlet.ServletRegistrationBean;
8
+import org.springframework.context.annotation.Bean;
6
 
9
 
7
 @SpringBootApplication
10
 @SpringBootApplication
8
 public class EtlCamelHugeApplication {
11
 public class EtlCamelHugeApplication {

+ 1 - 1
src/main/java/com/gct/tools/etlcamelhuge/camelconfig/CamelContextAwareConfiguration.java

@@ -33,7 +33,7 @@ public class CamelContextAwareConfiguration implements CamelContextAware, Applic
33
         this.camelContext = cc;
33
         this.camelContext = cc;
34
         camelContext.setNameStrategy(new DefaultCamelContextNameStrategy("lloyd-camel-etl"));
34
         camelContext.setNameStrategy(new DefaultCamelContextNameStrategy("lloyd-camel-etl"));
35
         final Map<String, RouteBuilder> beans = applicationContext.getBeansOfType(RouteBuilder.class);
35
         final Map<String, RouteBuilder> beans = applicationContext.getBeansOfType(RouteBuilder.class);
36
-        log.info("[I say:] total {} defined route builders ",beans.size());
36
+        log.info("[I say:] total {} defined route builders ", beans.size());
37
         for (RouteBuilder value : beans.values()) camelContext.addRoutes(value);
37
         for (RouteBuilder value : beans.values()) camelContext.addRoutes(value);
38
     }
38
     }
39
 
39
 

+ 9 - 3
src/main/java/com/gct/tools/etlcamelhuge/camelconfig/MyDataSourceConfiguration.java

@@ -16,17 +16,23 @@ import javax.sql.DataSource;
16
  * @since 2021/4/21 下午1:42
16
  * @since 2021/4/21 下午1:42
17
  */
17
  */
18
 @Configuration
18
 @Configuration
19
-public class MyDataSourceConfiguration  {
19
+public class MyDataSourceConfiguration {
20
 
20
 
21
     @Bean(name = "centralbase")
21
     @Bean(name = "centralbase")
22
     @ConfigurationProperties(prefix = "spring.datasource.ds1")
22
     @ConfigurationProperties(prefix = "spring.datasource.ds1")
23
-    public DataSource dataSource1( ){
23
+    public DataSource dataSource1() {
24
         return DataSourceBuilder.create().build();
24
         return DataSourceBuilder.create().build();
25
     }
25
     }
26
 
26
 
27
     @Bean(name = "diagnosis")
27
     @Bean(name = "diagnosis")
28
     @ConfigurationProperties(prefix = "spring.datasource.ds2")
28
     @ConfigurationProperties(prefix = "spring.datasource.ds2")
29
-    public DataSource dataSource2( ){
29
+    public DataSource dataSource2() {
30
+        return DataSourceBuilder.create().build();
31
+    }
32
+
33
+    @Bean(name = "oracle")
34
+    @ConfigurationProperties(prefix = "spring.datasource.ds3")
35
+    public DataSource dataSource3() {
30
         return DataSourceBuilder.create().build();
36
         return DataSourceBuilder.create().build();
31
     }
37
     }
32
 }
38
 }

+ 29 - 29
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelFileConfiguration.java

@@ -62,44 +62,44 @@ public class CamelFileConfiguration {
62
             public void configure() throws Exception {
62
             public void configure() throws Exception {
63
 //				from("jms-queue:queue:my-queue")
63
 //				from("jms-queue:queue:my-queue")
64
                 from("file:{{user.home}}/Desktop/cameltest/in")
64
                 from("file:{{user.home}}/Desktop/cameltest/in")
65
-                    .routeId("file-to-file")
65
+                        .routeId("file-to-file")
66
                         .transform()
66
                         .transform()
67
-                            .body(GenericFile.class, this::apply)
67
+                        .body(GenericFile.class, this::apply)
68
                         .log("this is my test -camel")
68
                         .log("this is my test -camel")
69
                         .setHeader("CamelFileName", () -> UUID.randomUUID().toString())
69
                         .setHeader("CamelFileName", () -> UUID.randomUUID().toString())
70
                         .tracing()
70
                         .tracing()
71
                         .process()
71
                         .process()
72
-                            .exchange(exchange -> {
73
-                                new Date().toInstant();
74
-                                LocalDateTime start = LocalDateTime.now();
75
-                                final Message in = exchange.getIn();
76
-                                String body = in.getBody(String.class);
77
-                                log.info("body is {}", body);
78
-                                Thread t = new Thread(() -> {
79
-                                    while (true) {
80
-                                        try {
81
-                                            Thread.sleep(1000);
82
-                                        } catch (InterruptedException e) {
83
-                                            e.printStackTrace();
84
-                                        }
85
-                                        log.warn("thread completed");
86
-                                        break;
72
+                        .exchange(exchange -> {
73
+                            new Date().toInstant();
74
+                            LocalDateTime start = LocalDateTime.now();
75
+                            final Message in = exchange.getIn();
76
+                            String body = in.getBody(String.class);
77
+                            log.info("body is {}", body);
78
+                            Thread t = new Thread(() -> {
79
+                                while (true) {
80
+                                    try {
81
+                                        Thread.sleep(1000);
82
+                                    } catch (InterruptedException e) {
83
+                                        e.printStackTrace();
87
                                     }
84
                                     }
88
-                                });
89
-                                t.start();
85
+                                    log.warn("thread completed");
86
+                                    break;
87
+                                }
88
+                            });
89
+                            t.start();
90
 
90
 
91
-                                try {
92
-                                    t.join();
91
+                            try {
92
+                                t.join();
93
 
93
 
94
-                                } catch (InterruptedException e) {
95
-                                    e.printStackTrace();
96
-                                }
94
+                            } catch (InterruptedException e) {
95
+                                e.printStackTrace();
96
+                            }
97
 
97
 
98
-                                final LocalDateTime end = LocalDateTime.now();
99
-                                final long l = Duration.between(start, end).toDays();
100
-                                log.warn("run with time : {}", l);
101
-                            })
102
-                .to("file:{{user.home}}/Desktop/cameltest/out");
98
+                            final LocalDateTime end = LocalDateTime.now();
99
+                            final long l = Duration.between(start, end).toDays();
100
+                            log.warn("run with time : {}", l);
101
+                        })
102
+                        .to("file:{{user.home}}/Desktop/cameltest/out");
103
             }
103
             }
104
         };
104
         };
105
     }
105
     }

File diff suppressed because it is too large
+ 148 - 50
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelJDBCConfiguration.java


+ 9 - 9
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelJMSConfiguration.java

@@ -21,15 +21,15 @@ import java.io.InputStreamReader;
21
  */
21
  */
22
 @Slf4j
22
 @Slf4j
23
 //@Configuration
23
 //@Configuration
24
-public class CamelJMSConfiguration  {
24
+public class CamelJMSConfiguration {
25
     @Bean
25
     @Bean
26
     RouteBuilder routeBuilderJms() {
26
     RouteBuilder routeBuilderJms() {
27
         return new RouteBuilder() {
27
         return new RouteBuilder() {
28
             @Override
28
             @Override
29
             public void configure() throws Exception {
29
             public void configure() throws Exception {
30
                 from("file:{{user.home}}/Desktop/cameltest/out")
30
                 from("file:{{user.home}}/Desktop/cameltest/out")
31
-                    .routeId("file-to-jms")
32
-                    .transform()
31
+                        .routeId("file-to-jms")
32
+                        .transform()
33
                         .body(GenericFile.class, gf -> {
33
                         .body(GenericFile.class, gf -> {
34
                             final BufferedReader in;
34
                             final BufferedReader in;
35
                             try {
35
                             try {
@@ -45,24 +45,24 @@ public class CamelJMSConfiguration  {
45
                                 throw new RuntimeException("read fault!");
45
                                 throw new RuntimeException("read fault!");
46
                             }
46
                             }
47
                         })
47
                         })
48
-                    .process()
48
+                        .process()
49
                         .exchange(exchange -> {
49
                         .exchange(exchange -> {
50
                             final Message in = exchange.getIn();
50
                             final Message in = exchange.getIn();
51
                             String body = in.getBody(String.class);
51
                             String body = in.getBody(String.class);
52
                             log.info("exchange is :" + body);
52
                             log.info("exchange is :" + body);
53
                         })
53
                         })
54
-                .to("jms:queue:testfiles").tracing();
54
+                        .to("jms:queue:testfiles").tracing();
55
 
55
 
56
                 from("jms:queue:testfiles")
56
                 from("jms:queue:testfiles")
57
-                    .routeId("jms-to-file")
58
-                    .transform()
57
+                        .routeId("jms-to-file")
58
+                        .transform()
59
                         .body(String.class, s -> s + "amazing\n")
59
                         .body(String.class, s -> s + "amazing\n")
60
-                    .process()
60
+                        .process()
61
                         .exchange(exchange -> {
61
                         .exchange(exchange -> {
62
                             final Message in = exchange.getIn();
62
                             final Message in = exchange.getIn();
63
                             log.info("from jms exchange is :" + in.getBody(String.class));
63
                             log.info("from jms exchange is :" + in.getBody(String.class));
64
                         })
64
                         })
65
-                .to("file:{{user.home}}/Desktop/cameltest/jmsout").tracing();
65
+                        .to("file:{{user.home}}/Desktop/cameltest/jmsout").tracing();
66
             }
66
             }
67
         };
67
         };
68
     }
68
     }

File diff suppressed because it is too large
+ 543 - 0
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelRestConfiguration.java


+ 26 - 5
src/main/resources/application.yml

@@ -1,4 +1,3 @@
1
-
2
 camel:
1
 camel:
3
   springboot:
2
   springboot:
4
     main-run-controller: true
3
     main-run-controller: true
@@ -8,7 +7,7 @@ spring:
8
     ds1:
7
     ds1:
9
       ## Hikari连接池的设置 Hikari 时间单位都是毫秒
8
       ## Hikari连接池的设置 Hikari 时间单位都是毫秒
10
       type: com.zaxxer.hikari.HikariDataSource
9
       type: com.zaxxer.hikari.HikariDataSource
11
-      jdbc-url: jdbc:postgresql://101.200.219.190:54321/database
10
+      jdbc-url: jdbc:postgresql://10.72.143.2:54321/database
12
       username: root
11
       username: root
13
       password: 123456
12
       password: 123456
14
       driver-class-name: org.postgresql.Driver
13
       driver-class-name: org.postgresql.Driver
@@ -30,7 +29,7 @@ spring:
30
     ds2:
29
     ds2:
31
       ## Hikari连接池的设置 Hikari 时间单位都是毫秒
30
       ## Hikari连接池的设置 Hikari 时间单位都是毫秒
32
       type: com.zaxxer.hikari.HikariDataSource
31
       type: com.zaxxer.hikari.HikariDataSource
33
-      jdbc-url: jdbc:postgresql://101.200.219.190:54321/diagnosis
32
+      jdbc-url: jdbc:postgresql://10.72.143.2:54321/diagnosis
34
       username: root
33
       username: root
35
       password: 123456
34
       password: 123456
36
       driver-class-name: org.postgresql.Driver
35
       driver-class-name: org.postgresql.Driver
@@ -49,6 +48,28 @@ spring:
49
         max-lifetime: 1800000
48
         max-lifetime: 1800000
50
         ## 数据库连接超时时间,默认30秒,即30000
49
         ## 数据库连接超时时间,默认30秒,即30000
51
         connection-timeout: 30000
50
         connection-timeout: 30000
51
+    ds3:
52
+      ## Hikari连接池的设置 Hikari 时间单位都是毫秒
53
+      type: com.zaxxer.hikari.HikariDataSource
54
+      jdbc-url: jdbc:oracle:thin:@10.72.181.234:1521:orcl
55
+      username: dhzdly
56
+      password: gctgct#831511
57
+      driver-class-name: oracle.jdbc.driver.OracleDriver
58
+      hikari:
59
+        ## 连接池名字
60
+        pool-name: SystemHikariCP
61
+        ## 最小空闲连接数量
62
+        minimum-idle: 5
63
+        ## 空闲连接存活最大时间,默认600000(10分钟)
64
+        idle-timeout: 60000
65
+        ## 连接池最大连接数,默认是10
66
+        maximum-pool-size: 15
67
+        ## 此属性控制从池返回的连接的默认自动提交行为,默认值:true
68
+        auto-commit: true
69
+        ## 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
70
+        max-lifetime: 1800000
71
+        ## 数据库连接超时时间,默认30秒,即30000
72
+        connection-timeout: 30000
52
 
73
 
53
 management:
74
 management:
54
   info:
75
   info:
@@ -60,11 +81,11 @@ management:
60
       enabled: true
81
       enabled: true
61
     camelroutecontroller:
82
     camelroutecontroller:
62
       enabled: true
83
       enabled: true
63
-#Actuator for camel was not supported at camel version > 3.4
84
+  #Actuator for camel was not supported at camel version > 3.4
64
   endpoints:
85
   endpoints:
65
     web:
86
     web:
66
       exposure:
87
       exposure:
67
-        include:  health, info,camelroutes , camelroutecontroller
88
+        include: health, info,camelroutes , camelroutecontroller
68
       cors:
89
       cors:
69
         allow-credentials: off
90
         allow-credentials: off
70
 server:
91
 server:

+ 74 - 8
src/test/java/com/gct/tools/etlcamelhuge/EtlCamelHugeApplicationTests.java

@@ -1,21 +1,45 @@
1
 package com.gct.tools.etlcamelhuge;
1
 package com.gct.tools.etlcamelhuge;
2
 
2
 
3
+import com.alibaba.fastjson.JSONArray;
4
+import com.alibaba.fastjson.JSONObject;
5
+import com.gct.tools.etlcamelhuge.entity.Response;
6
+import com.gct.tools.etlcamelhuge.routeconfig.CamelJDBCConfiguration;
7
+import io.micrometer.core.instrument.util.IOUtils;
3
 import lombok.Data;
8
 import lombok.Data;
9
+import org.apache.camel.AggregationStrategy;
10
+import org.apache.camel.CamelContext;
11
+import org.apache.camel.Exchange;
12
+import org.apache.camel.Processor;
13
+import org.apache.camel.builder.RouteBuilder;
14
+import org.apache.camel.http.common.HttpMessage;
15
+import org.apache.camel.impl.DefaultCamelContext;
16
+import org.apache.camel.model.ModelCamelContext;
4
 import org.junit.jupiter.api.Test;
17
 import org.junit.jupiter.api.Test;
5
 import org.junit.runner.RunWith;
18
 import org.junit.runner.RunWith;
19
+import org.springframework.beans.factory.annotation.Autowired;
6
 import org.springframework.boot.test.context.SpringBootTest;
20
 import org.springframework.boot.test.context.SpringBootTest;
21
+import org.springframework.context.annotation.Bean;
7
 import org.springframework.test.context.junit4.SpringRunner;
22
 import org.springframework.test.context.junit4.SpringRunner;
8
 
23
 
24
+import java.io.IOException;
25
+import java.io.InputStream;
9
 import java.lang.reflect.Array;
26
 import java.lang.reflect.Array;
10
 import java.lang.reflect.InvocationTargetException;
27
 import java.lang.reflect.InvocationTargetException;
28
+import java.text.SimpleDateFormat;
11
 import java.util.ArrayList;
29
 import java.util.ArrayList;
12
 import java.util.Arrays;
30
 import java.util.Arrays;
31
+import java.util.Date;
13
 import java.util.List;
32
 import java.util.List;
14
 
33
 
34
+import static org.junit.Assert.assertEquals;
35
+
15
 @RunWith(SpringRunner.class)
36
 @RunWith(SpringRunner.class)
16
 @SpringBootTest
37
 @SpringBootTest
17
 class EtlCamelHugeApplicationTests {
38
 class EtlCamelHugeApplicationTests {
18
 
39
 
40
+    @Autowired
41
+    RouteBuilder routeBuilder;
42
+
19
     @Test
43
     @Test
20
     public void contextLoads() {
44
     public void contextLoads() {
21
     }
45
     }
@@ -81,18 +105,19 @@ class EtlCamelHugeApplicationTests {
81
     }
105
     }
82
 
106
 
83
     @Data
107
     @Data
84
-    class te{
108
+    class te {
85
         private double m;
109
         private double m;
86
 
110
 
87
-//        @Cons
111
+        //        @Cons
88
         public te(double m) {
112
         public te(double m) {
89
             this.m = m;
113
             this.m = m;
90
         }
114
         }
91
     }
115
     }
116
+
92
     @Test
117
     @Test
93
     public void test3() {
118
     public void test3() {
94
 
119
 
95
-        te s=new te(0.9);
120
+        te s = new te(0.9);
96
         System.out.println(s);
121
         System.out.println(s);
97
         System.out.println(s.getClass());
122
         System.out.println(s.getClass());
98
         try {
123
         try {
@@ -113,7 +138,7 @@ class EtlCamelHugeApplicationTests {
113
             e.printStackTrace();
138
             e.printStackTrace();
114
         }
139
         }
115
 
140
 
116
-        ArrayList<Double> a1=new ArrayList<Double>();
141
+        ArrayList<Double> a1 = new ArrayList<Double>();
117
 
142
 
118
         a1.add(0.9);
143
         a1.add(0.9);
119
         a1.add(0.8);
144
         a1.add(0.8);
@@ -125,13 +150,13 @@ class EtlCamelHugeApplicationTests {
125
 
150
 
126
     }
151
     }
127
 
152
 
128
-    private <T> T[][] transfer(List<List<T>> source,Class<T> tClass){
153
+    private <T> T[][] transfer(List<List<T>> source, Class<T> tClass) {
129
 
154
 
130
-        List<T[]> l1=new ArrayList<>();
155
+        List<T[]> l1 = new ArrayList<>();
131
         for (List<T> ts : source) {
156
         for (List<T> ts : source) {
132
-            T[] t=(T[]) Array.newInstance(tClass,ts.size());
157
+            T[] t = (T[]) Array.newInstance(tClass, ts.size());
133
             for (int i = 0; i < ts.size(); i++) {
158
             for (int i = 0; i < ts.size(); i++) {
134
-                t[i]=ts.get(i);
159
+                t[i] = ts.get(i);
135
             }
160
             }
136
 
161
 
137
             l1.add(t);
162
             l1.add(t);
@@ -141,5 +166,46 @@ class EtlCamelHugeApplicationTests {
141
 
166
 
142
     }
167
     }
143
 
168
 
169
+    @Test
170
+    public void test10() {
171
+        JSONArray jsonArray = new JSONArray();
172
+        JSONObject search = new JSONObject();
173
+        JSONObject body = new JSONObject();
174
+        body.put("userno", "zdcycgtlyxt"); // 分配的系统用户账号
175
+        body.put("password", "Zdcycgtlyxt");
176
+        body.put("pageNo", 1); // 页码,从1开始
177
+        body.put("pageSize", 10);
178
+        search.put("field","父ID");
179
+        search.put("rule","=");
180
+        search.put("val","kvAfwAVEzv");
181
+        jsonArray.add(search);
182
+        body.put("search",jsonArray);
183
+        System.out.println(body);
184
+    }
185
+
186
+    public static void main(String args[]) throws Exception {
187
+        CamelContext context = new DefaultCamelContext();
188
+        //new ClassPathXmlApplicationContext("jetty/camel.xml");
189
+        context.addRoutes(new RouteBuilder() {
190
+            @Override
191
+            public void configure() {
192
+                JSONObject body = new JSONObject();
193
+                body.put("userno", "zdcycgtlyxt"); // 分配的系统用户账号
194
+                body.put("password", "Zdcycgtlyxt");
195
+                from("timer:mytimer?repeatCount=1")
196
+                        .setBody(simple(body.toJSONString()))
197
+                        .removeHeaders("CamelHttp*")
198
+                        .to("http://11.71.3.110:30010/dibs/0/service/token")
199
+                        .log("${body}:");
200
+            }
201
+        });
202
+        context.start();
203
+        boolean loop = true;
204
+        while (loop) {
205
+            Thread.sleep(25000);
206
+        }
207
+        context.stop();
208
+    }
209
+
144
 
210
 
145
 }
211
 }