Skip to content

Commit 4a35b7e

Browse files
Release 2.0.90
1 parent e86d8b0 commit 4a35b7e

File tree

17 files changed

+497
-627
lines changed

17 files changed

+497
-627
lines changed

manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ applications:
33
buildpack: java_buildpack
44
memory: 1G
55
timeout: 180
6-
path: target/data-exchange-2.0.89.jar
6+
path: target/data-exchange-2.0.90.jar
77
instances : 1
88
services:
99
- {uaaService}

manifest.yml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ applications:
33
buildpack: java_buildpack
44
memory: 1G
55
timeout: 180
6-
path: target/data-exchange-2.0.89.jar
6+
path: target/data-exchange-2.0.90.jar
77
instances : 1
88
services:
99
- {uaaService}

pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.ge.predix.solsvc</groupId>
77
<artifactId>data-exchange</artifactId>
8-
<version>2.0.89</version>
8+
<version>2.0.90</version>
99
<packaging>jar</packaging>
1010

1111
<parent>
@@ -16,13 +16,13 @@
1616
</parent>
1717

1818
<properties>
19-
<data-exchange-client.version>2.0.78</data-exchange-client.version>
20-
<fdh-asset-handler.version>2.0.78</fdh-asset-handler.version>
21-
<fdh-rabbitmq-handler.version>2.0.78</fdh-rabbitmq-handler.version>
22-
<fdh-timeseries-handler.version>2.0.78</fdh-timeseries-handler.version>
23-
<fdh-eventhub-handler.version>2.0.78</fdh-eventhub-handler.version>
24-
<fdh-websocket-handler.version>2.0.78</fdh-websocket-handler.version>
25-
<fdh-custom-handler.version>2.0.78</fdh-custom-handler.version>
19+
<data-exchange-client.version>2.0.79</data-exchange-client.version>
20+
<fdh-asset-handler.version>2.0.79</fdh-asset-handler.version>
21+
<fdh-rabbitmq-handler.version>2.0.79</fdh-rabbitmq-handler.version>
22+
<fdh-timeseries-handler.version>2.0.79</fdh-timeseries-handler.version>
23+
<fdh-eventhub-handler.version>2.0.79</fdh-eventhub-handler.version>
24+
<fdh-websocket-handler.version>2.0.79</fdh-websocket-handler.version>
25+
<fdh-custom-handler.version>2.0.79</fdh-custom-handler.version>
2626

2727
<jettison.version>1.1</jettison.version>
2828
<cxf.version>3.1.7</cxf.version>
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
package com.ge.predix.solsvc.fdh.router.boot;
2+
3+
import java.util.Arrays;
4+
import java.util.Iterator;
5+
6+
import org.slf4j.Logger;
7+
import org.slf4j.LoggerFactory;
8+
import org.springframework.boot.SpringApplication;
9+
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
10+
import org.springframework.boot.autoconfigure.SpringBootApplication;
11+
import org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration;
12+
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
13+
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
14+
import org.springframework.context.ApplicationContext;
15+
import org.springframework.context.annotation.Bean;
16+
import org.springframework.context.annotation.ComponentScan;
17+
import org.springframework.context.annotation.Configuration;
18+
import org.springframework.context.annotation.ImportResource;
19+
import org.springframework.context.annotation.PropertySource;
20+
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
21+
import org.springframework.core.env.MutablePropertySources;
22+
import org.springframework.web.context.support.StandardServletEnvironment;
23+
import org.springframework.web.socket.config.annotation.EnableWebSocket;
24+
25+
/**
26+
* DataEchangeRouter routes traffic to FDH Handlers. FDH Handlers implement the exact
27+
* same API Interface and can be called directly. But this microservice provides
28+
* a single point of entry for Analytic Service calls and then the calls fan out
29+
* based on rules.
30+
*
31+
* @author predix
32+
*/
33+
@SpringBootApplication
34+
@Configuration
35+
@ComponentScan(basePackages = "com.ge.predix.solsvc.fdh.handler")
36+
@EnableAutoConfiguration(exclude =
37+
{
38+
DataSourceAutoConfiguration.class, JpaRepositoriesAutoConfiguration.class,
39+
PersistenceExceptionTranslationAutoConfiguration.class
40+
})
41+
@ImportResource(
42+
{
43+
"classpath*:META-INF/spring/data-exchange-cxf-context.xml",
44+
"classpath*:META-INF/spring/data-exchange-scan-context.xml"
45+
})
46+
@PropertySource("classpath:application-default.properties")
47+
@EnableWebSocket
48+
public class DataExchangeRouterApplication extends PredixSpringBootInitializer
49+
{
50+
51+
private static final Logger log = LoggerFactory.getLogger(DataExchangeRouterApplication.class);
52+
53+
/**
54+
* @param args
55+
* -
56+
*/
57+
public static void main(String[] args)
58+
{
59+
Logger log = LoggerFactory.getLogger(DataExchangeRouterApplication.class);
60+
61+
SpringApplication springApplication = new SpringApplication(DataExchangeRouterApplication.class);
62+
ApplicationContext ctx = springApplication.run(args);
63+
64+
log.info("Let's inspect the beans provided by Spring Boot:"); //$NON-NLS-1$
65+
66+
String[] beanNames = ctx.getBeanDefinitionNames();
67+
Arrays.sort(beanNames);
68+
for (String beanName : beanNames)
69+
{
70+
log.info(beanName);
71+
}
72+
73+
// log.info("Let's inspect the profiles provided by Spring Boot:");
74+
String profiles[] = ctx.getEnvironment().getActiveProfiles();
75+
for (int i = 0; i < profiles.length; i++)
76+
log.info("profile=" + profiles[i]); //$NON-NLS-1$
77+
78+
log.info("Let's inspect the properties provided by Spring Boot:"); //$NON-NLS-1$
79+
MutablePropertySources propertySources = ((StandardServletEnvironment) ctx.getEnvironment())
80+
.getPropertySources();
81+
Iterator<org.springframework.core.env.PropertySource<?>> iterator = propertySources.iterator();
82+
while (iterator.hasNext())
83+
{
84+
Object propertySourceObject = iterator.next();
85+
if ( propertySourceObject instanceof org.springframework.core.env.PropertySource )
86+
{
87+
org.springframework.core.env.PropertySource<?> propertySource = (org.springframework.core.env.PropertySource<?>) propertySourceObject;
88+
log.info("propertySource=" + propertySource.getName() + " values=" + propertySource.getSource() //$NON-NLS-1$ //$NON-NLS-2$
89+
+ "class=" + propertySource.getClass()); //$NON-NLS-1$
90+
}
91+
}
92+
93+
// Spring is a little bit of a hog on startup, after that it's not too bad.
94+
System.gc();
95+
printMemory();
96+
97+
}
98+
99+
/**
100+
* -
101+
*/
102+
@SuppressWarnings("nls")
103+
public static void printMemory()
104+
{
105+
Runtime runtime = Runtime.getRuntime();
106+
int mb = 1024 * 1024;
107+
108+
log.info("##### Heap utilization statistics [MB] #####");
109+
110+
// Print used memory
111+
log.info("Used Memory:" + (runtime.totalMemory() - runtime.freeMemory()) / mb);
112+
113+
// Print free memory
114+
log.info("Free Memory:" + runtime.freeMemory() / mb);
115+
116+
// Print total available memory
117+
log.info("Total Memory:" + runtime.totalMemory() / mb);
118+
119+
// Print Maximum available memory
120+
log.info("Max Memory:" + runtime.maxMemory() / mb);
121+
122+
// log.info("VCAP_SERVICES"+System.getenv("VCAP_SERVICES"));
123+
}
124+
125+
/**
126+
* Add this bean or the @PropertySource above won't kick in
127+
*
128+
* @return -
129+
*/
130+
@Bean
131+
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer()
132+
{
133+
return new PropertySourcesPlaceholderConfigurer();
134+
}
135+
136+
}

src/main/java/com/ge/predix/solsvc/fdh/router/boot/FdhRouterApplication.java

Lines changed: 0 additions & 133 deletions
This file was deleted.

src/main/java/com/ge/predix/solsvc/fdh/router/service/DataExchangeRouterController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class DataExchangeRouterController
7979
private GetRouter getRouter;
8080

8181
@Autowired
82-
private PutRouter metaDataputFieldDataService;
82+
private PutRouter metaDataPutFieldDataService;
8383

8484
@Autowired
8585
private IServiceManagerService serviceManagerService;
@@ -138,7 +138,7 @@ public PutFieldDataResult putFieldData(MessageContext context, PutFieldDataReque
138138
List<Header> headers = DataExchangeUtil.getRequestHeadersToKeep(context, headersToKeep);
139139

140140
Map<Integer, Object> modelLookupMap = new HashMap<Integer, Object>();
141-
PutFieldDataResult putFieldDataResult = this.metaDataputFieldDataService.putData(putFieldDataRequest, modelLookupMap , headers);
141+
PutFieldDataResult putFieldDataResult = this.metaDataPutFieldDataService.putData(putFieldDataRequest, modelLookupMap , headers);
142142
return putFieldDataResult;
143143
}
144144
catch (Throwable e)
@@ -172,7 +172,7 @@ public PutFieldDataResult putFieldData(MessageContext context,MultipartBody body
172172
List<Header> headers = new ArrayList<Header>();
173173
headers.add(new BasicHeader("Authorization", context.getHttpHeaders().getHeaderString("Authorization")));
174174

175-
PutFieldDataResult putFieldDataResult = this.metaDataputFieldDataService.putData(putFieldDataRequest, modelLookupMap, headers);
175+
PutFieldDataResult putFieldDataResult = this.metaDataPutFieldDataService.putData(putFieldDataRequest, modelLookupMap, headers);
176176

177177
return putFieldDataResult;
178178

src/main/java/com/ge/predix/solsvc/fdh/router/service/router/MetaDataPutDataRouterImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* @author predix
4343
*/
44-
@Component(value = "metaDataputFieldDataService")
44+
@Component(value = "metaDataPutFieldDataService")
4545
public class MetaDataPutDataRouterImpl extends PutDataRouterImpl
4646
{
4747
private static final Logger log = LoggerFactory.getLogger(MetaDataPutDataRouterImpl.class);

src/main/java/com/ge/predix/solsvc/fdh/router/service/router/PutDataRouterImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import com.ge.predix.solsvc.ext.util.JsonMapper;
4242
import com.ge.predix.solsvc.fdh.handler.FDHUtil;
4343
import com.ge.predix.solsvc.fdh.handler.PutDataHandler;
44-
import com.ge.predix.solsvc.fdh.router.boot.FdhRouterApplication;
44+
import com.ge.predix.solsvc.fdh.router.boot.DataExchangeRouterApplication;
4545
import com.ge.predix.solsvc.fdh.router.validator.RouterPutDataCriteriaValidator;
4646
import com.ge.predix.solsvc.fdh.router.validator.RouterPutDataValidator;
4747
import com.ge.predix.solsvc.restclient.impl.RestClient;
@@ -87,7 +87,7 @@ public PutFieldDataResult putData(PutFieldDataRequest request, Map<Integer, Obje
8787
List<Header> headers)
8888
{
8989

90-
FdhRouterApplication.printMemory();
90+
DataExchangeRouterApplication.printMemory();
9191
this.validator.validate(request);
9292
PutFieldDataResult fullResult = new PutFieldDataResult();
9393
for (PutFieldDataCriteria criteria : request.getPutFieldDataCriteria())

src/main/resources/META-INF/spring/fdh-router-cxf-context.xml renamed to src/main/resources/META-INF/spring/data-exchange-cxf-context.xml

File renamed without changes.

src/main/resources/META-INF/spring/fdh-router-scan-context.xml renamed to src/main/resources/META-INF/spring/data-exchange-scan-context.xml

File renamed without changes.

0 commit comments

Comments
 (0)