Coder Social home page Coder Social logo

anilallewar / microservices-basics-spring-boot Goto Github PK

View Code? Open in Web Editor NEW
712.0 712.0 435.0 5.36 MB

Basic architecture framework to create complete microservices using Spring boot and Spring cloud

License: Apache License 2.0

Java 71.11% HTML 6.66% Shell 5.61% JavaScript 6.44% FreeMarker 2.22% Groovy 0.84% Dockerfile 5.48% TSQL 1.00% Smarty 0.63%

microservices-basics-spring-boot's People

Contributors

1singhmanmeet avatar akinmail avatar anilallewar avatar ramazansakin avatar stevewallone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

microservices-basics-spring-boot's Issues

Update Docker run documentation

You need to update documentation to reflect your image name and version on some of your docker run examples.

docker run -d --name config-server -p 8888:8888 anilallewar/config-server

Should be

docker run -d --name config-server -p 8888:8888 anilallewar/basic-config-server:0.0.1

Dockercompoise appears OK

Issue when build webservice-registry. You can fix it?

Hi all,
I'm building webservice-registry. but i have a problem with webservice-registry.
I'm using gradle version 4.2 and java 8.
Please tell me about. How to fix it.
Thanks.

FAILURE: Build failed with an exception.

  • What went wrong:
    Failed to capture snapshot of input files for task ':compileJava' property 'classpath' during up-to-date check.

java.lang.UnsupportedOperationException (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.it

Invalid access token: while trying to access task-service

Hi,

I am trying to run this example application i have set up everything and its working fine but there are some exception is task-service.

when i am trying to access http://localhost:8765/task-service i am getting following error

Invalid access token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MDcxNjUwNzIsInVzZXJfbmFtZSI6ImFuaWwiLCJhdXRob3JpdGllcyI6WyJST0xFX0FETUlOIiwiUk9MRV9VU0VSIl0sImp0aSI6ImVhZGIxM2ViLWRlOGYtNDk3Mi04ZGJlLTBhYmMzNzE0OTZkYiIsImNsaWVudF9pZCI6ImFjbWUiLCJzY29wZSI6WyJvcGVuaWQiXX0.XkcrzfnoxkJCsbZFA3DvPrwLyRtURXQqu8iQW9RJaeE6cyGmsLYPLEwDBaUlfiIkuSdMjZJLtIOfG9B9rP7qD-JlqQu27t5EUjEY6SpgVR7vg2Wm-RxP69nqQatEmJ72U5h17JCHEX_buQNtmnzNRhzIrN0t2pYjjJzFTeZYtzG0vIXsDpPpi3ASTpdT17wWM6EvEiU4vIloLuqbNUEOS7JbcoMDOzizHMD9Bc1SEJ7wbGI8Esib7FvcAkVf_MKwobeWWRoeLeP96g5FsnpIJVhLfJ3HHJAtofmMXpfiP9_K6FDoaXPddeaFG2SZY9Uo2YkeJu_OsTq4fcaXTUqvbQ invalid_token

Service not remove from Eureka server when stop docker container

when service container stop by user.service not remove from eureka server
after search in internet i found this post
https://stackoverflow.com/questions/31836498/sigterm-not-received-by-java-process-using-docker-stop-and-the-official-java-i
and i solved this problem by change entry point in docker file.

#-----------------------------------------------------------------------------------------------------
# User Service
#-----------------------------------------------------------------------------------------------------
FROM openjdk:8u121-jdk-alpine

MAINTAINER Anil Allewar <[email protected]>

# Keep consistent with build.gradle 
ENV APP_JAR_NAME basic-user-webservice
ENV APP_JAR_VERSION 0.0.1

# Install curl
RUN apk --update add curl bash && \
	rm -rf /var/cache/apk/*
	
RUN mkdir /app

ADD ${APP_JAR_NAME}-${APP_JAR_VERSION}.jar /app/service.jar 
ADD run.sh /app/
RUN chmod +x /app/run.sh 

WORKDIR /app

EXPOSE 8080

ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/urandom",  "-Dspring.profiles.active=docker",  "-jar",  "/app/service.jar"]

Cors Problem

Hi,
how to resolve cors problem? I have an application on different host.
When i call http://localhost:8899/userauth/oauth/token?grant_type=password&username....
from http://localhost:3000/.... Chrome call url in OPTIONS method.
From AuthService i receive a 401 and log show

2017-12-28 15:58:41.214 DEBUG 8300 --- [nio-8899-exec-2] o.s.security.web.FilterChainProxy : /oauth/token?grant_type=password&username=anil&password=password at position 5 of 11 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
2017-12-28 15:58:41.214 DEBUG 8300 --- [nio-8899-exec-2] o.s.security.web.FilterChainProxy : /oauth/token?grant_type=password&username=anil&password=password at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2017-12-28 15:58:41.214 DEBUG 8300 --- [nio-8899-exec-2] o.s.security.web.FilterChainProxy : /oauth/token?grant_type=password&username=anil&password=password at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2017-12-28 15:58:41.216 DEBUG 8300 --- [nio-8899-exec-2] o.s.security.web.FilterChainProxy : /oauth/token?grant_type=password&username=anil&password=password at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2017-12-28 15:58:41.219 DEBUG 8300 --- [nio-8899-exec-2] o.s.s.w.a.AnonymousAuthenticationFilter : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9055c2bc: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
2017-12-28 15:58:41.219 DEBUG 8300 --- [nio-8899-exec-2] o.s.security.web.FilterChainProxy : /oauth/token?grant_type=password&username=anil&password=password at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'
2017-12-28 15:58:41.219 DEBUG 8300 --- [nio-8899-exec-2] o.s.security.web.FilterChainProxy : /oauth/token?grant_type=password&username=anil&password=password at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2017-12-28 15:58:41.219 DEBUG 8300 --- [nio-8899-exec-2] o.s.security.web.FilterChainProxy : /oauth/token?grant_type=password&username=anil&password=password at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2017-12-28 15:58:41.221 DEBUG 8300 --- [nio-8899-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/oauth/token'; against '/oauth/token'
2017-12-28 15:58:41.221 DEBUG 8300 --- [nio-8899-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor : Secure object: FilterInvocation: URL: /oauth/token?grant_type=password&username=anil&password=password; Attributes: [fullyAuthenticated]
2017-12-28 15:58:41.222 DEBUG 8300 --- [nio-8899-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor : Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@9055c2bc: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS
2017-12-28 15:58:41.232 DEBUG 8300 --- [nio-8899-exec-2] o.s.s.access.vote.AffirmativeBased : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@1ff98b36, returned: -1
2017-12-28 15:58:41.246 DEBUG 8300 --- [nio-8899-exec-2] o.s.s.w.a.ExceptionTranslationFilter : Access is denied (user is anonymous); redirecting to authentication entry point

org.springframework.security.access.AccessDeniedException: Access is denied

Can't access api via curl

Using my browser for authentication works fine. I get redirected to auth-server, log in successfully and get redirected to zuul again and getting information from a protected microservice.

Using curl to obtain a token also works fine but using this token with the "Authorization: Bearer xxx..." header to get a resource doesn't work. I always get redirected to the login page.

Maybe this is related to:
kakawait/uaa-behind-zuul-sample#13

The documentation from the auth-server (in this project) says that getting resources via curl should be also possible. What am i doing wrong?

UPDATE
Got it working using @ResourceServer annotation instead of @EnableOAuth2Sso annotation (both isn't possible so easy at this time) and extending ResourceServerConfigurerAdapter.

...
@EnableResourceServer
public class ZuulServerApplication extends ResourceServerConfigurerAdapter {
...

I would be glad if you could provide a solution which is able to handle both.

When doing zuul proxy call from api gateway to microservices getting empty response

Its great microservice project, I am using this template as my reference and developed a microservice application every thing working fine, now the problem is when i do the proxy call to the microservices the data from microservice are coming as excepted but if I hit the url continuously getting the empty response..
What may be the reason for it?

Ports exposed by rancher are not reachable

When i run project with Rancher, ports exposed by Rancher are not reachable.
If you look at the picture you can see ports exposed but when i try to access it this failed.
Thanks
rancher_dashboard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.