快速入门

安装

使用maven:

<dependency>
    <groupId>org.redkale</groupId>
    <artifactId>redkale</artifactId>
    <version>2.7.0</version>
</dependency>

Super-powers are granted randomly so please submit an issue if you're not happy with yours.

如果工程需要用到Redis、Kafka、Elasticsearch、SQL模板、模板引擎等,可使用redkale的官方插件:

<dependency>
    <groupId>org.redkalex</groupId>
    <artifactId>redkale-plugins</artifactId>
    <version>2.7.0</version>
</dependency>

创建工程

在IDE中使用ant或maven方式创建工程,增加redkale的依赖。然后下载 ˚ 解压并覆盖到工程目录下。

bin: 存放启动/关闭脚本(start.sh、shutdown.sh、redkale.sh等) conf : 存放服务器所需配置文件: application.xml: 服务配置文件 (必需); logging.properties:日志配置文件 (可选); source.properties: 数据库配置文件 (可选); lib : 存放服务所依赖jar logs : logging.properties 配置中默认的日志存放目录。

Hello World

演示工程:

下载 redkale-2.7.0.tar.gz 解压并覆盖到工程目录下

编写HelloService:

调试运行:

选择 Application 模式

运行日志:

在浏览器输入: http://127.0.0.1:6060/pipes/hello/say 可以看到结果:

在浏览器输入: http://127.0.0.1:6060/pipes/hello/hi?name=Redkale 可以看到结果:

最后更新于

这有帮助吗?