Skip to content

FrankNPC/bitryon-spring-rmi-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Maven Central Spring Boot License

Quick start RPC in spring web

  • If proxy the interfaces from another repo, make sure turn on -parameters on that repo to keep parameter's name of methods. so the parameters of post/get can against methods on interfaces.
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.13.0</version>
				<configuration>
					<compilerArgs>
						<arg>-parameters</arg>
					</compilerArgs>
				</configuration>
			</plugin>
		</plugins>
  • The class name and method will be translated to path string:

AccountServiceImpl.login(String username, String password) -> account/login. method name in the service should be different. so client and server can communicate through HTTP, like the app/h5/SDKs call to the service.

  • The parameters right on the method in types of primitives will be in the URL as query string.

keeping the parameter names by [-parameters].

  • Configure serializer and deserializer if needed or leave it to default jackson ObjectMapper

See RestClient.builder().messageConverters(HttpMessageConverter)

  • Examples:

Server side: ExampleServiceProvider

Client side: ExampleServiceSubscriber

About

A simple RPC framework to call remote spring bean service through HTTP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages