org.springframework.util.JdkIdGenerator源码实例Demo

类org.springframework.util.JdkIdGenerator源码实例Demo

下面列出了org.springframework.util.JdkIdGenerator 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: brewery   文件: PresentController.java
@RequestMapping(
		value = "/order",
		method = POST)
String order(HttpEntity<String> body) {
	String processIdFromHeaders = body.getHeaders().getFirst(PROCESS_ID_HEADER_NAME);
	String processId = StringUtils.hasText(body.getHeaders().getFirst(PROCESS_ID_HEADER_NAME)) ?
			processIdFromHeaders :
			new JdkIdGenerator().generateId().toString();
	log.info("Making new order with [{}] and processid [{}].", body.getBody(), processId);
	Span span = this.tracer.nextSpan().name("inside_presenting").start();
	Tracer.SpanInScope ws = tracer.withSpanInScope(span);
	try {
		String testCommunicationType = BaggageField.getByName("TEST-COMMUNICATION-TYPE").getValue();
		log.info("Found the following communication type [{}]", testCommunicationType);
		switch (testCommunicationType) {
		case "FEIGN":
			return useFeignToCallAggregation(body, processId);
		default:
			return useRestTemplateToCallAggregation(body, processId);
		}
	} finally {
		span.finish();
		ws.close();
	}
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 类方法
 同包方法