rabbitmq rpc 消息格式及调用封装
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
453 B

  1. package rabbitmqrpc
  2. const DES_KEY = "mqbitrab"
  3. type MsgBody struct {
  4. Exchange string
  5. Key string
  6. Data string
  7. }
  8. type MsgSend struct {
  9. Result string
  10. }
  11. func rpc_server_conn(url ...string) (*RabbitmqServiceClient, error) {
  12. var wx_rpc_url string = "127.0.0.1:7955"
  13. if len(url) > 0 && url[0] != "" {
  14. wx_rpc_url = url[0]
  15. }
  16. conn, _, err := DialRabbitmqService("tcp", wx_rpc_url)
  17. if err != nil {
  18. return nil, err
  19. }
  20. return conn, nil
  21. }