When calling the Message Queue JCQ SDK or openAPI to perform the sending consumption and management operations of message, the user's identity information needs to be verified to check the validity of the user identity, that is, AccessKey and SecretKey need to be created in the console or the created Key needs to be used.
Apply for AccessKey and SecretKey Key (AK/SK for short) in the AccessKey Management Page in the Account Management of JD Cloud User Center. Please appropriately keep your AK/SK information. If lost, your cloud resources may be operated by illegal users with this information, and you may suffer data and property loss. The AK/SK Key is allowed to be enabled and disabled. It can be used to call OpenAPI after it is enabled, and cannot be used to call OpenAPI after it is disabled.
Please create the topic and consumerGroup in the console or by calling OpenAPI to acquire the Topic and ConsumerGroup ID, and acquire the access point of the created topic.
Methods of Acquiring Access Point in the Console:
After the above resources are created, they can be initialized in the program.
/** * User accessKey */ private static final String ACCESS_KEY = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0"; /** * User secretKey */ private static final String SECRET_KEY = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB0"; /** * Metadata Server Address (Access Point Address) */ private static final String META_SERVER_ADDRESS = "127.0.0.1:18888"; /** * topic Name */ private static final String TOPIC = "testTopic"; /** * Consumer Group Id */ private static final String CONSUMER_GROUP_ID = "testConsumerGroup";