Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
/ z-mhus-micro Public archive

Microservice framework for seamless usage of different technologies

License

Notifications You must be signed in to change notification settings

mhus/z-mhus-micro

Repository files navigation

Test using docker

mkdir ~/tmp/micro_discovery

docker run -it \
 -v ~/.m2:/home/user/.m2\
 -p 15006:5005\
 -p 18182:8181\
 -h karaf1\
 --name karaf1\
 -v ~/tmp/micro_discovery:/opt/karaf/micro_discovery\
 mhus/apache-karaf:4.2.6_04 debug

feature:repo-add mvn:org.apache.shiro/shiro-features/1.5.1/xml/features
feature:repo-add mvn:de.mhus.osgi/mhus-features/7.2.0-SNAPSHOT/xml/features

feature:install eventadmin

feature:install mhu-micro

install -s mvn:de.mhus.osgi/dev-micro/7.2.0-SNAPSHOT



Rest provider:

feature:install mhu-rest
install -s mvn:de.mhus.micro/micro-oper-rest/7.0.0-SNAPSHOT

blue-create de.mhus.rest.osgi.RestServlet

Test in browser:

http:https://localhost:18182/rest/public/operation/de.mhus.osgi.dev.critical.micro.Hello/1.0.0?_method=POST

http:https://localhost:18182/rest/public/operation/de.mhus.osgi.dev.critical.micro.Hello/0.0.0?load={next:"x"}



Discover via file system:

blue-create de.mhus.micro.impl.FsPusher

blue-create de.mhus.micro.impl.FsDiscoverer



Rest executor:

install -s mvn:de.mhus.micro/micro-execute-rest/7.0.0-SNAPSHOT

Test with second client:

docker run -it \
 -v ~/.m2:/home/user/.m2\
 -p 15007:5005\
 -p 18183:8181\
 -h karaf2\
 --name karaf2\
 -v ~/tmp/micro_discovery:/opt/karaf/micro_discovery\
 --link karaf1:karaf1 \
 mhus/apache-karaf:4.2.6_04 debug



feature:repo-add mvn:org.apache.shiro/shiro-features/1.5.1/xml/features
feature:repo-add mvn:de.mhus.osgi/mhus-features/7.2.0-SNAPSHOT/xml/features

feature:install eventadmin

feature:install mhu-micro

install -s mvn:de.mhus.micro/micro-execute-rest/7.0.0-SNAPSHOT

blue-create de.mhus.micro.impl.FsDiscoverer

Test Redis

Start redis and UI:

docker run --name karaf-redis -d redis:6.0.8-alpine

docker run -ti -d -p 5001:5001 --name karaf-redisui --link karaf-redis:redis marian/rebrow

Access via: http:https://localhost:5001/redis:6379/0/


Start karaf1:

docker run -it \
 -v ~/.m2:/home/user/.m2\
 -p 15006:5005\
 -p 18182:8181\
 -h karaf1\
 --name karaf1\
 --link karaf-redis:redis\
 mhus/apache-karaf:4.2.6_04 debug


Install:

feature:repo-add mvn:org.apache.shiro/shiro-features/1.5.1/xml/features
feature:repo-add mvn:de.mhus.osgi/mhus-features/7.2.0-SNAPSHOT/xml/features

feature:install eventadmin

feature:install mhu-micro

install -s mvn:de.mhus.osgi/dev-micro/7.2.0-SNAPSHOT

feature:install mhu-rest
install -s mvn:de.mhus.micro/micro-oper-rest/7.0.0-SNAPSHOT

blue-create de.mhus.rest.osgi.RestServlet

install -s mvn:de.mhus.micro/micro-execute-rest/7.0.0-SNAPSHOT

install -s mvn:de.mhus.micro/micro-discover-redis/7.0.0-SNAPSHOT




Start karaf2:

docker run -it \
 -v ~/.m2:/home/user/.m2\
 -p 15007:5005\
 -p 18183:8181\
 -h karaf2\
 --name karaf2\
 --link karaf1:karaf1\
 --link karaf-redis:redis\
 mhus/apache-karaf:4.2.6_04 debug


Install:

feature:repo-add mvn:org.apache.shiro/shiro-features/1.5.1/xml/features
feature:repo-add mvn:de.mhus.osgi/mhus-features/7.2.0-SNAPSHOT/xml/features

feature:install eventadmin

feature:install mhu-micro

install -s mvn:de.mhus.micro/micro-execute-rest/7.0.0-SNAPSHOT

install -s mvn:de.mhus.micro/micro-discover-redis/7.0.0-SNAPSHOT

Test on / off operations

blue-create de.mhus.osgi.dev.micro.AnotherOperation


blue-delete de.mhus.osgi.dev.micro.AnotherOperation

Test JMS

1)
feature:repo-add activemq 5.15.8
feature:install mhu-jms
2)
bundle:install -s mvn:de.mhus.lib.itest/examples-jms/7.0.0-SNAPSHOT
3)
dev-res -y cp examples-jms
4)
install -s mvn:de.mhus.micro/micro-oper-jms/7.0.0-SNAPSHOT

karaf1 only:
5)
blue-create de.mhus.micro.oper.jms.DefaultOperationsChannel

karaf2 Test:
operation-execute -l trans=jms de.mhus.osgi.dev.critical.micro.Hello 2.0.0

About

Microservice framework for seamless usage of different technologies

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages