These are chat archives for spring-cloud/spring-cloud

15th
Feb 2019
Chandrakanth Reddy
@CHANDRAKANTHREDDY93
Feb 15 03:22
I've a method in jersey with return type ResponseBuilder, I want to convert that method to Spring boot, How can I do that?
Method looks some thing like this public ResponseBuilder createResponse(String lang, String name){ ResponseBuilder rb = Response.status(Status.Ok); return rb;}
Davin Kevin
@davinkevin
Feb 15 06:59

Hi everyone.

I am using Spring-Cloud-Sleuth (through Spring Cloud GCP) to forward headers (X-B3) between my micro-services using Spring-webflux everywhere. In one of them, the HTTP call is made from a different thread (inside a spring batch job, async, triggered by a rest endpoint). It seems the headers are not forwarded in this case. Is it normal for you to see this kind of behavior?

Thanks

jerryniu
@geercode
Feb 15 08:05
I think it's referred.Because the tracing route is DAG.It means all spans should travel back in a sequence.If you want to know async call's referrence,u should get spanId making another tag to refer it.
Maxime Menard
@mmenard-bbc
Feb 15 11:16
Hi all, question for spring-cloud-gateway, is it possible to use ReadBodyPredicateFactory in a .yml config file instead of code ? I can't find any documentation on it
Sven Sander
@yarodinD
Feb 15 14:37
Hello together
I'm currently getting familiar with spring-cloud-contract. I use the central contracts approach described in the documentation and it works so far. Only thing that bothers me a bit are the packages the generated test classes reside. They are produced by using the base class package first, concatinated with the whole groupId/artifactId of the server (since this is the path the contracts are in) which is very long and not really matching the expectations. It works; so this is more a cosmetic issue. Is there a way to change that? Haven't found anything.
Spencer Gibb
@spencergibb
Feb 15 15:30
@mmenard-bbc no it's not
Marcin Grzejszczak
@marcingrzejszczak
Feb 15 16:52
@davinkevin it depends. Either we have no instrumented it or maybe from the process perspective it just can't work
@yarodinD you can override them
basePackageForTests: Specifies the base package for all generated tests. If not set, the value is picked from baseClassForTests’s package and from `packageWithBaseClasses. If neither of these values are set, then the value is set to org.springframework.cloud.contract.verifier.tests.
mars009
@mars009
Feb 15 17:46
Hi guys, just a quick question. I am disabling the trace endpoint and its filter, but it seems eureka is looking for a filter that matches "webRequestLoggingFilter". I am creating a dummy version that will just log the request when one comes along, but I was wondering if internally Eureka is doing something with all the info stored in the TraceRepository or if its safe to just replace it with the new one
Sven Sander
@yarodinD
Feb 15 20:21
@marcingrzejszczak Yes, I know. But this property is still treated as a prefix, appended by the path of the contract itself. Same behaviour like with the Baseclass. The path of the contract itself already constitutes the correct package name, therefore an empty prefix would be nice, but setting the basePackageForTests to empty causes spring-cloud-contract to use the default: org.springframework.cloud.... as a prefix before my own package name.
Marcin Grzejszczak
@marcingrzejszczak
Feb 15 22:32
I don't understand what you're saying
Sven Sander
@yarodinD
Feb 15 23:36
Ok, an example. Using contracts from a central repository as described in https://cloud.spring.io/spring-cloud-static/spring-cloud-contract/2.1.0.RELEASE/single/spring-cloud-contract.html#_common_repo_with_contracts all contracts are in a directory consisting of the maven group and artifact Ids of the server (in the documentation the server has com.example:server.
When the maven plugin from spring-cloud-contract pulls that contract and creates the tests from it, this folder becomes the package name. If a basePackageForTests or packageWithBaseClasses is set (let's say to "com.example.server.mytest.TestBase", I get a package like this: "com.example.server.mytest.com.example.server". Clear now what I mean?