Git Product home page Git Product logo

microservice's People

Contributors

7-- avatar clintoncao avatar ewolff avatar larzenegger avatar matthiasbalke avatar mvitz avatar ramazansakin avatar spencergibb 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  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

microservice's Issues

Facing problem in pushing spring boot app on pivotal cloud foundry

I am trying to push the simple spring boot app in pcf.
I am completely new to pcf.

I was created manifest.yml file which contain following data:-

applications:
- name: PivotalPushTest
  host: PivotalPushTest
  memory: 512M
  instances: 1
  path: /root/Desktop/PivotalPushTest/target/PivotalPustTest-0.0.1-SNAPSHOT.jar

but when I am pushing this app via cf push command I am getting following error:-

cf push

Using manifest file /root/Desktop/PivotalPushTest/manifest.yml

Creating app PivotalPushTest in org ORGNAME / space Java-Hadoop as [email protected]...
OK

Using route PivotalPushTest.url.com
Binding PivotalPushTest.url.com to PivotalPushTest...
OK

Uploading PivotalPushTest...
Uploading app files from: /tmp/unzipped-app911037164
Uploading 6.1K, 16 files
Done uploading               
OK

Starting app PivotalPushTest in org ORGNAME / space Java-Hadoop as [email protected]...
Downloading python_buildpack...
Downloading php_buildpack...
Downloading java_buildpack_offline...
Downloading null_buildpack...
Downloading go_buildpack_1-6...
Downloading staticfile_buildpack...
Downloading binary_buildpack...
Downloading ruby_buildpack...
Downloading nodejs_buildpack...
Downloading go_buildpack...
Downloaded python_buildpack
Downloaded nodejs_buildpack
Downloaded binary_buildpack
Downloaded php_buildpack
Downloaded go_buildpack
Downloaded go_buildpack_1-6
Downloaded ruby_buildpack
Downloaded java_buildpack_offline
Downloaded null_buildpack
Downloaded staticfile_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (6.6K)
Staging...
-----> Nothing to do.
**No start command detected; command must be provided at runtime**
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (109B)
Uploaded droplet (3.7K)
Uploading complete

0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful

TIP: use 'cf logs PivotalPushTest --recent' for more information

In Apps Manager Logs:-

 OUT Exit status 1
2016-09-28T07:05:58.000+00:00 [APP] **ERR Usage: /tmp/lifecycle/launcher <app directory> <start command> <metadata>**
2016-09-28T07:05:58.000+00:00 [CELL] OUT Exit status 2
2016-09-28T07:05:58.000+00:00 [API] OUT App instance exited with guid 637a95a7-4def-4c43-b00e-454ca6f584f8 payload: {"instance"=>"460e1817-d616-495e-407e-49991b0026b0", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>1, "crash_timestamp"=>1475046358426721004, "version"=>"e54e765b-8472-41d5-b14c-eec3f1d41401"}
2016-09-28T07:05:58.000+00:00 [CELL] OUT Creating container
2016-09-28T07:05:58.000+00:00 [CELL] OUT Successfully created container
2016-09-28T07:05:58.000+00:00 [CELL] OUT Starting health monitoring of container
2016-09-28T07:05:58.000+00:00 [APP] OUT Exit status 1
2016-09-28T07:05:58.000+00:00 [APP] **ERR Usage: /tmp/lifecycle/launcher <app directory> <start command> <metadata>**
2016-09-28T07:05:58.000+00:00 [CELL] OUT Exit status 2
2016-09-28T07:05:59.000+00:00 [API] OUT App instance exited with guid 637a95a7-4def-4c43-b00e-454ca6f584f8 payload: {"instance"=>"06f0d873-0050-4e66-6bc8-11ec83ec369f", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>2, "crash_timestamp"=>1475046358988785723, "version"=>"e54e765b-8472-41d5-b14c-eec3f1d41401"}
2016-09-28T07:05:59.000+00:00 [CELL] OUT Creating container
2016-09-28T07:05:59.000+00:00 [CELL] OUT Successfully created container
2016-09-28T07:05:59.000+00:00 [CELL] OUT Starting health monitoring of container
2016-09-28T07:05:59.000+00:00 [APP] OUT Exit status 1
2016-09-28T07:05:59.000+00:00 [APP] ERR Usage: /tmp/lifecycle/launcher <app directory> <start command> <metadata>
2016-09-28T07:05:59.000+00:00 [CELL] OUT Exit status 2 

Please Help,
Abhijeet.

Vagrant up / provision not working

I'm trying to run Your example, but I am getting the following error while executing the command 'vagrant up' or 'vagrant provision' - since I'm new to vagrant and docker I don't know how to fix this. I'm using Windows 7. Can You help me please?

The command '/bin/sh -c apk add --update wget ca-certificates && cd /tmp && wget -nv "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk" "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk" && apk add --allow-untrusted glibc-2.21-r2.apk glibc-bin-2.21-r2.apk && /usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib && echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && wget -nv --header "Cookie: oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" && tar xzf "jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" && mkdir -p /usr/lib/jvm && mv "/tmp/jdk1.${JAVA_VERSION}.0_${JAVA_UPDATE}" "/usr/lib/jvm/java-${JAVA_VERSION}-oracle" && ln -s "java-${JAVA_VERSION}-oracle" $JAVA_HOME && ln -s $JAVA_HOME/bin/java /usr/bin/java && ln -s $JAVA_HOME/bin/javac /usr/bin/javac && rm -rf $JAVA_HOME/src.zip && rm -rf $JAVA_HOME/lib/missioncontrol $JAVA_HOME/lib/visualvm $JAVA_HOME/lib/javafx* $JAVA_HOME/jre/lib/plugin.jar $JAVA_HOME/jre/lib/ext/jfxrt.jar $JAVA_HOME/jre/bin/javaws $JAVA_HOME/jre/lib/javaws.jar $JAVA_HOME/jre/lib/desktop $JAVA_HOME/jre/plugin $JAVA_HOME/jre/lib/deploy* $JAVA_HOME/jre/lib/javafx $JAVA_HOME/jre/lib/jfx $JAVA_HOME/jre/lib/amd64/libdecora_sse.so $JAVA_HOME/jre/lib/amd64/libprism.so $JAVA_HOME/jre/lib/amd64/libfxplugins.so $JAVA_HOME/jre/lib/amd64/libglass.so $JAVA_HOME/jre/lib/amd64/libgstreamer-lite.so $JAVA_HOME/jre/lib/amd64/libjavafx_.so $JAVA_HOME/jre/lib/amd64/libjfx_.so && rm -rf $JAVA_HOME/jre/bin/jjs $JAVA_HOME/jre/bin/keytool $JAVA_HOME/jre/bin/orbd $JAVA_HOME/jre/bin/pack200 $JAVA_HOME/jre/bin/policytool $JAVA_HOME/jre/bin/rmid $JAVA_HOME/jre/bin/rmiregistry $JAVA_HOME/jre/bin/servertool $JAVA_HOME/jre/bin/tnameserv $JAVA_HOME/jre/bin/unpack200 $JAVA_HOME/jre/lib/ext/nashorn.jar $JAVA_HOME/jre/lib/jfr.jar $JAVA_HOME/jre/lib/jfr $JAVA_HOME/jre/lib/oblique-fonts && apk del wget ca-certificates && rm /tmp/_ /var/cache/apk/*' returned a non-zero code: 4

How would you implement a shopping cart?

Thanks for writing the book "Das Microservices-Praxisbuch". I really enjoyed reading it. The full running examples are amazing.
But I still have some questions, especially about some concepts of SCS.

I am struggeling to implement a shopping cart.

(1) In your example the form for adding order lines is in the order service. Usually in a web shop each item has a "add to cart" button (catalog service). So the best way to do this, would be some frontend integration and call the "addLine" functionality (order service) from catalog service? For sure the full shopping cart page will be provided by the order service.
addToCart

(2) If I have a none logged in user, how can I save the cart on server? I need some kind of identifier. Can I use the sessionId (and sticky sessions when I have a loadbalancer) or would it break the concept of SCS.

(3) Somewhere in the checkout process (order service) you have to validate the item data like price (never trust the frontend) from the catalog service. In the SCS way there should not be synchronous calls, so the order service has to know all prices of all items forehanded (through async call). But then there is still the possibility to checkout an item without the correct price (when price update event from catalog service was not processed in the order service).

Port mapping

I was having problems to build the demo but I figured out the issue. I was running another container on port 8080. It would be helpful if you write down all the ports used by the microservices.

How to Push MicroServioce in PCF?

Hi,
Thanks for your post.
We have already written microservices and we would like to push it on pcf.
But we dont know how to proceed further as we are new to deploy microservices on pcf.
We just want to push a addition microservice which is written in maven(java).
i.e it includes,
1:-EurekaServer
2:-MicroServiceForAddition
3:-DiscoveryClient

Do we need to add manifest file to push the app,if yes then,
We have provided the manifest file which includes,

App name
Instances
Hostname
Memory

Please suggest me.
Thanks.
Mohan.V

vagrant and docker

Hi,

I tried to do what you did, but failed on the following command:
vagrant provision

The problem is, that vagrant says:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

      rm -f /var/lib/vagrant/cids/9ecc8459ea5f39f9da55cb4d71a70b5d1e0f0b80
      docker run --cidfile=/var/lib/vagrant/cids/9ecc8459ea5f39f9da55cb4d71a70b5d1e0f0b80 -d --name frontend --restart=always -p 8090:8090 -v /frontend:/frontend frontend

Stdout from the command:

Stderr from the command:

stdin: is not a tty
docker: Error response from daemon: Conflict. The name "/frontend" is already in use by container e3ae5840fdda3a5532ccbf5c6e26cf69069053997d45ea1a8f94addd56710f47. You have to remove (or rename) that container to be able to reuse that name..
See 'docker run --help'.

Vagrant removes the cid, bu des not remove the named container.
Do you know why?

Vagrantfile run directives only executed during provisioning

The vagrant provisioning documentation states:

run - Run a container and configure it to start on boot.

I therefore assumed that during the first execution, the respective loop in the Vagrantfile would first build the docker images, then run the containers while also configuring them to start on subsequent calls.
However, when I run

vagrant up

then check that the services were started (they were). Then run

vagrant halt
vagrant up

the docker containers are not started. Message:

==> default: Machine already provisioned. Run vagrant provision or use the --provision
==> default: to force provisioning. Provisioners marked to run always will still run.

Perhaps I'm misunderstanding the procedure. In the meantime, af9260f seems to be a usable workaround. But is that how it's supposed to be configured or just a misinterpretation of the warning/informational message?

Executing vagrant provision first

Hi,

I had some issues starting this example.

1st was that my vagrant VM could not connect to internet and that the trust needs an update before installation of docker was a success. (Always ended up with "Docker installation failed".

So, I have added following lines in the Vagrantfile:

config.vm.provider :virtualbox do |vb|
      vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  end
  config.vm.provision "shell", inline: "sudo apt-get update"

2nd was that it seems to be necessary to run
vagrant provision
before
vagrant up

Therefore, it should be added to the ReadMe.txt. Took me some time to understand what is failing. On the other hand, I have learned something more about vagrant docker integration. :)

Eureka Tests fail with Java 9

Any new members using Java 9 to test this project, you might encounter test failures like below.

org.springframework.web.client.HttpClientErrorException: 404 null
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)
	at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:700)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:653)
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:613)
	at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:312)
	at com.ewolff.microservice.eurekaserver.ApplicationTests.catalogLoads(ApplicationTests.java:25)

The root cause is java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present.
Refer Java 9 explanationhere

So just down grade your JDK to work until there is a fix available.

Multiple exceptions raised when running `docker-compose up`

Thanks, @ewolff for providing this sample application. I am eager to learn from it and experiment with it.

I have built the application through a mvn clean package in microservice-demo and then ran docker-compose up in docker. During bootstrapping, a number of exceptions are being raised. It seems like discovery does not work.

Please see the entire log file here.

Build Fail for Eureka-Server

Hello

I'm using the latest version of your code to build (02/01).
The build has been failed with the log below.
Can you recommend to solve this issue?
Thank you

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.eureka.server.EurekaServerConfiguration];

Results :

Tests in error:
ApplicationTests.adminLoads » IllegalState Failed to load ApplicationContext
ApplicationTests.catalogLoads » IllegalState Failed to load ApplicationContext

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] microservice-demo .................................. SUCCESS [ 1.036 s]
[INFO] microservice-demo-eureka-server .................... FAILURE [ 7.324 s]
[INFO] microservice-demo-turbine-server ................... SKIPPED
[INFO] microservice-demo-customer ......................... SKIPPED
[INFO] microservice-demo-catalog .......................... SKIPPED
[INFO] microservice-demo-order ............................ SKIPPED
[INFO] microservice-demo-zuul-server ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Q: How to best deal with artefact versioning in Dockerfiles?

Say you want (read: "have") to increase the version number of microservice-demo-catalog (pom.xml), are you suggesting to also adapt the new version number in Dockerfile respectively, is there a recommendation on how to achieve this most elegantly (using environment variables or such) ?

Error on executing vagrant up

Hello,
Pease can u help me.
Your tuterial is interseted, I tried to execute vargant up but I alwayes get erreur.

.......
==> default: Forwarding ports...
default: 8080 (guest) => 18080 (host) (adapter 1)
default: 8761 (guest) => 18761 (host) (adapter 1)
default: 8989 (guest) => 18989 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.36
default: VirtualBox Version: 5.1
==> default: Mounting shared folders...
default: /vagrant => D:/worktraining/architecture/microservice-master/docker-vagrant
default: /microservice-demo => D:/worktraining/architecture/microservice-master/microservice-demo
==> default: Machine already provisioned. Run vagrant provision or use the --provision
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running provisioner: docker...
==> default: Starting Docker containers...
==> default: -- Container: eureka
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

      rm -f /var/lib/vagrant/cids/8471cfc1fb670d34d41fc592fb1a3a5662ede334
      docker run --cidfile=/var/lib/vagrant/cids/8471cfc1fb670d34d41fc592fb1a3a5662ede334 -d --name eureka --restart=always -p 8761:8761 -v /microservice-demo:/microservice-demo eureka

Stdout from the command:

Stderr from the command:

Unable to find image 'eureka:latest' locally
docker: Error response from daemon: repository eureka not found: does not exist or no pull access.
See 'docker run --help'.

Tests are breaking in microservice-demo-catalog

Someone did commit

[INFO] Reactor Summary:
[INFO]
[INFO] microservice-demo ................................. SUCCESS [39.818s]
[INFO] microservice-demo-eureka-server ................... SUCCESS [2:22.265s]
[INFO] microservice-demo-turbine-server .................. SUCCESS [7.110s]
[INFO] microservice-demo-customer ........................ SUCCESS [1:17.839s]
[INFO] microservice-demo-catalog ......................... SUCCESS [50.993s]
[INFO] microservice-demo-order ........................... FAILURE [37.500s]
[INFO] microservice-demo-zuul-server ..................... SKIPPED

Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 28.675 sec <<< FAILURE! - in com.ewolff.microservice.order.logic.CatalogConsumerDrivenContractTest
testFindAll(com.ewolff.microservice.order.logic.CatalogConsumerDrivenContractTest) Time elapsed: 1.721 sec <<< ERROR!
java.lang.NullPointerException: null
at com.ewolff.microservice.order.logic.CatalogConsumerDrivenContractTest.testFindAll(CatalogConsumerDrivenContractTest.java:35)

Build errors, openjdk 11, ubuntu 18.04

Build, ends up in the following errors:

[INFO] Reactor Summary:
[INFO]
[INFO] microservice-demo 0.0.1-SNAPSHOT ................... SUCCESS [ 3.459 s]
[INFO] microservice-demo-eureka-server .................... SUCCESS [ 29.669 s]
[INFO] microservice-demo-turbine-server ................... SUCCESS [ 0.945 s]
[INFO] microservice-demo-customer ......................... FAILURE [ 44.390 s]
[INFO] microservice-demo-catalog .......................... SKIPPED
[INFO] microservice-demo-order ............................ SKIPPED
[INFO] microservice-demo-zuul-server 0.0.1-SNAPSHOT ....... SKIPPED

3 errors are issued:

[ERROR] testFindAll(com.ewolff.microservice.customer.cdc.CustomerConsumerDrivenContractTest) Time elapsed: 0 s <<< ERROR!
[ERROR] testValidCustomerId(com.ewolff.microservice.customer.cdc.CustomerConsumerDrivenContractTest) Time elapsed: 0 s <<< ERROR!
[ERROR] testGetOne(com.ewolff.microservice.customer.cdc.CustomerConsumerDrivenContractTest) Time elapsed: 0 s <<< ERROR!

Out of curiosity, does this example uses any database? I couldn't find one...

Fix request: Request without GET or POST

Greetings,

We are researchers and we are have identified insecure coding patterns and configurations in the microservice architecture repositories. In your repository, we have found instances of @RequestMapping" methods without POST or GET . According to the Common Weakness Enumeration and JAVA OWASP, this is a security weakness and needs to be avoided.

We request for a fix for this issue. Looking forward for your feedback.

Source:

@RequestMapping(value = "/{id}.html", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)

Pipeline with multimodules

Hello,

I am seeing the repository and I have one doubt, Is correct have one repo with N modules when we are using microservice (as in the sample project)?
My doubt is because when you will create a new pipeline generally you have one repo per pipeline, and if you have N projects I don't know how to config the pipeline.
Another point would be regarding the need to check out all sources to develop.

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.