The Java Client for Hyphenate Services is for use in server applications on a proxy server, aka, your developer server. Client library serves as a wrapper layer on top of raw REST APIs that allows you to deploy on your server and make APIs requests. See Hyphenate APIs.
This library is open source. We encourage you to contribute to make the code base better! If you encountered any bug or feature suggestion, please submit an issue or email [email protected] for urgent fixes.
- Hyphenate API key. learn more or create one.
- Java 1.7 or later. Latest version of the Java.
You can add the library via Gradle or Maven, which we recommended, or compile it from command line.
Update Hyphenate app configurations in config.properties
.
API_ORG = hyphenatedemo
API_APP = demo
APP_CLIENT_ID = YXA68E7DkM4uEeaPwTPbScypMA
APP_CLIENT_SECRET = YXA63_RZdbtXQB9QZsizSCgMC70_4Rs
-
package io.hyphenate.server.jersey is using Jersey 2.15. Java 7 or later is required.
-
package io.hyphenate.server.httpclient is using Httpclient 4.3.3. Java 1.5 or later is required.
-
Install JUnit library (ex. junit:junit:4.12)
We recommend using maven or gradle to build server components.
Keystore Generation with public site certificate
By default, requests are sent at the expected rate limits for each web service, typically 30 queries per second for free users.
Each IP address is limited to 30 requests per second. Requests beyond this limit will receive a 429 or 503 error. If you received this error, please reduce the request frequency and try again.
Please contact Hyphenate [email protected] if you need higher request rate.
You can use IntelliJ, Eclipse, NetBeans or any Java IDE you prefer to the run the project.
$ gradle eclipse
Run the following command, it'll generate necessary Eclipse files, then import via Eclipse
> gradlew.bat eclipse
-
"Import Project" -> select project root folder -> select "Import project from external model" -> select "Gradle" -> select "Use auto-import" and "Create separate module per source set" -> select "Use default gradle wrapper" -> Select "1.7" for Gradle JVM -> ".idea" for project format -> click "Finish"
Run the following command and open the project from Intellij IDEA
> gradlew.bat idea
Compile and package the project
$ ./gradlew jar
see all Gradle commands
$ ./gradlew tasks
> gradlew.bat clean compile
If you're not using the tools listed above, you can manual manage the .jar package by running the following command.
> gradlew.bat distZip
That will create a zip file, hyphenate-server-example.zip, under the folder build/distributions, which includes all the dependency