• Welcome to follow my public number

  • Development background: The Pos system of the company’s new retail terminal has been changed from Youzan strategy to Meituan, but the store is still the same, but my grandpa is not the original grandpa, so he rolled up his sleeves and started to work

  • We property during blowing a bit tight, ha ha, the main reason is that I was too busy, I want to draw a prototype, to development of Pos system, to upgrade the store tools, use the built-in printer, going to new stores machine, sometimes also concerned about the material of stores, the worst I have to contact supplier purchasing hardware devices, so sorry, said in a blog, So I kept putting it off. I was really busy

Create a project

  • I made a small mistake and created a project namedpp.id=retail-push-order-pafcIt’s in this format, but I created it in the remote projectpp.id=retail-pushorder-pafcThe jar will fail to be created when the Jenkins index is created for the first time. Hope to pay attention next time.
  • The code is pretty much the same as before, the only difference being passingmqI’m going to take the message, and THEN I’m going to process each message and then I’m going to assemble it into a new Json and then I’m going to push it through, and the other details are in the first projectThe first official Java backend program of theI’m just going to write different places here
  • Something that needs to be added
#rocketmq
rocketmq.namesrv-addr=
#zookeeper
elasticjob.zk.serverLists
eureka.client.serviceUrl.defaultZone

# Other configurations
spring.application.name=retail-pushorder-pafc
server.port=8194
rocketmq.producer-group-name=retail-retail-push-order-pafc-producer
rocketmq.consumer-group-name=retail-retail-push-order-pafc-consumer

Copy the code

* RocketMQ message queues are one of the core components of highly concurrent systems that can help business systems deconstruct and improve development efficiency and system stability. See RocketMQ Principles & Best Practices

Other Config

  • Generally using MQ projects will definitely require a common configuration in order to use it
  • Since the test ID is different from the official ID, and I cannot change the code often, I need a WebConfig to determine the current environment, so that the same set of code can be used in the coordinated environment and the official environment

  • Mq has consumer and producer: one is the consumer and the producer. Currently, my module is the consumer without producer, but this message is also sent to me by other modules

  • Our process of issuing packages

    • Upload code togitFactory repository, merge code intomaterBranch,Tag.TagThe general format isV1.0.0 A01_20190312Or an official bagV1.0.0 R01_20190312“And then tell test your branch andTag, they buildjar, and then test — go live.

Problems encountered

  • Encounter problem 1:

    • Background: VPN, when I am doing logistics module last year, in the company’s computer, is not to need to what kind of VPN, this year I also don’t know this thing, because no dev environment and external alignment of the environment a lot of didn’t get through, cause I am in dev debugging impossible (is our cash register is using a third party system, the third party give orders to push over). I had to go to qa environment to debug, and I didn’t expect that VPN is also required in QA environment. This problem stuck me for several days, and I almost uninstalled the IDE. I must have asked someone else!

    • The VPN account and password need to be maintained and logged in to read Apollo configuration of QA environment

  • This is it

  • Problem 2: QA does not output logs

    • The reason is that MY local project was canceled, and the QA server also canceled the project, so I didn’t receive it. I just need to close the project later
  • Encounter problem three:

    • Throw a questionfloat floatPrice= 9/100; System.out.println(floatPrice);The results for0.0You have to cast it if you want to get the resultfloat floatPrice= (float) 9/100; System.out.println(floatPrice);In our project, we use points, but the other system receives the yuan, so we need to convert the unit, which is the basic knowledge of Java

  • Problem four:

    • The online environment Apollo cannot read, so the solution is that the online environment Apollo also needs to create an Apollo configuration with the same name as the project, even though I’m going to read a generic configuration, but I have to create this as well
  • Encounter problem five:

    • No MQ messages are received and the other configurations are fine because they need to be created manuallyTopicIn fact, it can be created automatically or manually, qa environment is automatically created, online environment is manual, our company operations did not know this, it took a few hours, haha

  • Encounter problem six:
    • Pushed all the messages through. There should be9About ten thousand order data, etcTopicCreate, push all at once, originally want to push today’s orders, but the history of orders also push all of the past

Contract online

  • To apply for online

  • See push success message, OK, finish

  • Finally, I would like to thank The elder brother and Wang Hong for their help, as well as the guidance of the architect Guo, and the help of the operation and maintenance Zhang Yu