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

9th
Mar 2018
Tyler Van Gorder
@tkvangorder
Mar 09 2018 00:27
@joshuawhite929 It really depends on what spring-cloud projects you are using. The one "Gotcha" that we have run into as we have moved from the different 1.3.x, 1.4.x, and 1.5.x branches is with spring cloud stream and its kafka binder. The downstream dependency on different versions of kafka and the kafka client can be problematic. The spring-kafka project has a clearly defined matrix of spring-kafka -> kafka version. If you are using spring cloud stream with a kafka binder, you want to avoid mixing different versions of the kafka client.
Abhishek Dujari
@abshkd
Mar 09 2018 02:30
@marcingrzejszczak thank you. I am reading from the start
will look at workshops first
Abhishek Dujari
@abshkd
Mar 09 2018 02:39
the problem is I dont have a producer project. All I have is the consumer side. from docs it sseems the producer generates the artifact somewhere else, outside my project
We describe the flow here
Abhishek Dujari
@abshkd
Mar 09 2018 08:13
@marcingrzejszczak thank you
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 08:14
np
to shortly recap - either you set up contracts on the consumer side and shoot requests at the real thing via those tests, or (I think that's a better way), you setup a WireMock proxy, you write tests that send requests to the real app via proxy. The proxy stores wiremock stubs that you can package. Both approaches are shown in the legacy app
Abhishek Dujari
@abshkd
Mar 09 2018 08:18
you have a whole presentation on this that I did not even see. sorry for taking up your time. Hopefully, in some way, I can help to return the favor
I like the way to create stubs from recorded responses. for the most part it will work for me very well.
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 09:04
:+1:
you can return the favour
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 09:15
if you want to see other presentations you can check out the sample videos from my homepage http://toomuchcoding.com/abstracts/
taigi100
@taigi100
Mar 09 2018 12:26
Hey, where can I find the possible yaml configuration properties available for a certain package? For example: security oauth2. Been looking for the and can't seem to find them.
Abhishek Dujari
@abshkd
Mar 09 2018 14:15
@marcingrzejszczak from what legacyapp example. We need to use subprojects? Like one from stub and one for our actual project? is it possible to use in existing project. I am not very familiar with pom/maven
i get it to work
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 14:16
I don't understand the question

we need to use subprojects?

who is we? Need to use subprojects to do what?

Abhishek Dujari
@abshkd
Mar 09 2018 14:16
like there is one Impl which I assume is the consumer project. then there is stubs
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 14:17
the legacy app has terrible project structure
Abhishek Dujari
@abshkd
Mar 09 2018 14:17
they seem like 2 different maven projects with 1 parent
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 14:17
becayse well it's a legacy app ;)
Abhishek Dujari
@abshkd
Mar 09 2018 14:17
oh i see
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 14:17
The Legacy App
This legacy app is a stereotypical monolith, with legacy code that nobody loves. It has an anemic structure. We’ve left just one domain which is the CustomerRentalHistory. It will call this API https://stripe.com/docs/api/java#list_charges
this is the 1st line of readme
Abhishek Dujari
@abshkd
Mar 09 2018 14:17
haha
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 14:18
I see that you haven't read it? :P
Abhishek Dujari
@abshkd
Mar 09 2018 14:18
i did just didnt think the project structure is also reflective of that
when we add the maven plugin what is this for <configuration> <baseClassForTests>
is that the baseclass of the stub?
Abhishek Dujari
@abshkd
Mar 09 2018 14:23
oh nvm you show it later int he video i am just going to watch from the beginning
Abhishek Dujari
@abshkd
Mar 09 2018 14:49
is this way of writing a URL correct for contract
import org.springframework.cloud.contract.spec.Contract

Contract.make {
    description """
        should return a list of games
"""
    request {
        url "http://library-service/gameslist"
        method GET()
    }
    response {
        status 200
        body(["games1, games2, games3"])
    }

}
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 14:56

oh nvm you show it later int he video i am just going to watch from the beginning

that's a very good hint in general ;) maybe also first read the documentation of spring cloud contract to understand what the tool is about?

s this way of writing a URL correct for contract

Please read the documentation and watch the video

I explain that in the video
Abhishek Dujari
@abshkd
Mar 09 2018 14:57
will do sir. doing it now
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 14:58
:+1:
Abhishek Dujari
@abshkd
Mar 09 2018 14:59
i am watching this one https://www.youtube.com/watch?v=UwwaWodTj1k&list=PLxZQe6I1pYpfbUI587PZ7CY0l3oKPg9hH&index=28 also then try the code myself using my sample project
totally unintentional blowup video
Marcin Grzejszczak
@marcingrzejszczak
Mar 09 2018 15:00
I have provided you with the link to the video related to the legacy app
where I explain what I'm doing
Abhishek Dujari
@abshkd
Mar 09 2018 15:01
yes i followed that and the code. but the maven part confuses me. it doesnt build a stub for me given the contract
Could not resolve dependencies for project spring.cloud:games:jar:0.0.1-SNAPSHOT: Failure to find spring.cloud:library-service:jar:1.0
i am doing mvnw clean install but then this is my consumer project
i assume that i need to include both the stub runner and the contract verifier in my legacy app
not to worry i will have this figured out in a couple of hours or days
i am a big idiot tbh
Abhishek Dujari
@abshkd
Mar 09 2018 15:08
on your legacy app talk, right at the beginning what maven command did you run to generate the stub?
you did not run it because of some issue
Abhishek Dujari
@abshkd
Mar 09 2018 15:32
ok i got atleast my 1st step working
i watched the video realllly slow
you dont actually add the dependency for the stub
what you did was add the plugin and run without tests
that generated something
Abhishek Dujari
@abshkd
Mar 09 2018 15:45
see trhis is the part i dont get https://youtu.be/JEmpIDiX7LU?t=13m3s
not sure if the timing is in but in my targets after install I have no pom.xml
also my stub jar is called <projectid>-<version>-stubs.jar
ok i can run the test but its calling the base url
so i need to understand how the external url is specified. i have done the properties part
Abhishek Dujari
@abshkd
Mar 09 2018 15:52
i always get Request was not matched
Uri Goldstein
@urig
Mar 09 2018 16:12
Hello. Is this the right place to ask for a bit of help with Spring Cloud Feign? :)
Uri Goldstein
@urig
Mar 09 2018 20:33
Turns out my issue isn't Feign, it's a conflict between Spring Cloud and Spring Boot when they're in the same pom.xml. Might anyone be able to help? https://stackoverflow.com/questions/49201687/how-to-run-both-spring-boot-and-spring-cloud-in-the-same-maven-project
Spencer Gibb
@spencergibb
Mar 09 2018 20:51
made a comment on the issue
not a great title for the issue BTW.
@urig :arrow_up:
Uri Goldstein
@urig
Mar 09 2018 21:16
Thanks for your help Spencer. Unfortunately my issue persists.
I would refine the title if only I knew how :)
Any ideas on how to proceed?
Spencer Gibb
@spencergibb
Mar 09 2018 21:19
Can you provide a complete, minimal, verifiable sample (see https://stackoverflow.com/help/mcve) that reproduces the problem?
Uri Goldstein
@urig
Mar 09 2018 21:21
I thought I could - by downloading a project from Initializr. Fails for me 100% of the time. But since it doesn't fail for you then it must be something outside of the code and I'm not sure how to provide that.
In the meanwhile I've deleted my .m2 repo entirely and spring-boot:run is now downloading all dependencies from scratch. Fingers crossed.
Uri Goldstein
@urig
Mar 09 2018 21:29
I think that did the trick. Running into different issues now. Thanks Spencer!
Spencer Gibb
@spencergibb
Mar 09 2018 21:33
NP
Uri Goldstein
@urig
Mar 09 2018 21:53
@spencergibb Maybe you can also help with For artifact {org.springframework.cloud:spring-cloud-starter-zipkin:null:jar}: The version cannot be empty. that I'm getting now?
Ok. Forcing update fixed that and now I'm at
Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured. ...?
Uri Goldstein
@urig
Mar 09 2018 22:09
NM. Yet another corrupt package. Works now. Thanks and good night.