Need help with jt-framework?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

hylexus
202 Stars 77 Forks 208 Commits 4 Opened issues

Description

基于Spring-Boot的JT-808协议服务端

Services available

!
?

Need anything else?

Contributors list

# 146,895
Java
146 commits

jt-framework

Jt-808协议服务端。

Docs

ChangeLog

🐞 Bug Fixes

  • https://github.com/hylexus/jt-framework/issues/44

⭐ New Features

新增配置项:

  • jt808.server.idle-state-handler
    : 对应
    io.netty.handler.timeout.IdleStateHandler
    的 三个属性:
    readerIdleTime
    writerIdleTime
    allIdelTime
    。 默认值都是
    20m
    ;
  • jt808.protocol.max-frame-length
    : 对应
    io.netty.handler.codec.DelimiterBasedFrameDecoder
    maxFrameLength
    属性。

QuickStart

1. 创建工程

创建一个空的

spring-boot
工程。

2. 添加依赖

引入为

808协议
提供的
spring-boot-starter
  • gradle
dependencies {
    // ...
    implementation group: 'io.github.hylexus.jt', name: 'jt-808-server-spring-boot-stater', version: "1.0.12-RELEASE"
    // ...
}
  • maven
    io.github.hylexus.jt
    jt-808-server-spring-boot-stater
    1.0.12-RELEASE

3. 配置

  • application.yml
jt808:
  print-component-statistics: true
logging:
  level: info
  level.io.github.hylexus: debug
  • @EnableJt808ServerAutoConfig
    启用自动配置
@SpringBootApplication
// 启用自动配置
@EnableJt808ServerAutoConfig
public class Jt808ServerSampleBareApplication {

public static void main(String[] args) {
    SpringApplication.run(Jt808ServerSampleBareApplication.class, args);
}

}

Features

  • 注解驱动开发
    • 基于注解的请求消息映射
    • 基于注解的Handler,参数自动注入
    • 基于注解的响应消息映射
    • 基于注解的消息下发
  • 支持消息下发
  • 定制化
    • BytesEncoder:自定义转义逻辑
    • RequestMsgDispatcher:自定义
      MsgDispatcher
    • RequestMsgQueue:自定义
      MsgQueue
      ,内置基于
      Google-EventBus
      的 MsgQueue
    • RequestMsgQueueListener:自定义
      MsgQueueListener
      ,内置基于
      Google-EventBus
      的 MsgQueueListener
    • ResponseMsgBodyConverter:自定义消息转换器
    • HandlerMethodArgumentResolver:自定义参数解析器,类似于SpringMVC的
      HandlerMethodArgumentResolver
    • 报文构建器:
      io.github.hylexus.jt.msg.builder.jt808.Jt808MsgBuilder
    • ……

Building from Source

请事先安装

Lombok
插件。
  • Mac/Linux/Unix-Based System

shell script
./gradlew clean build
  • Windows

shell script
./gradlew.bat clean build

Modules

.
├── build-script    # gradle用到的构建脚本和checkstyle配置
├── docs            # 文档 (vue-press)
├── gradle
├── jt-808-server-spring-boot-stater
├── jt-808-server-support
├── jt-core
├── jt-spring
└── samples         # 示例项目
    ├── jt-808-server-sample-bare           # 几乎零配置的示例
    ├── jt-808-server-sample-annotation     # 注解相关的示例
    └── jt-808-server-sample-customized     # 定制化示例

Reporting Issues

  • GitHub提交Issue
  • QQ交流群 : 1072477383

Community

QQ交流群

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.