Java Code Examples for io.openmessaging.KeyValue#containsKey()

The following examples show how to use io.openmessaging.KeyValue#containsKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocalMessageCache.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
MessageExt poll(final KeyValue properties) {
    int currentPollTimeout = clientConfig.getOmsOperationTimeout();
    if (properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)) {
        currentPollTimeout = properties.getInt(PropertyKeys.OPERATION_TIMEOUT);
    }
    return poll(currentPollTimeout);
}
 
Example 2
Source File: LocalMessageCache.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 5 votes vote down vote up
MessageExt poll(final KeyValue properties) {
    int currentPollTimeout = clientConfig.getOmsOperationTimeout();
    if (properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)) {
        currentPollTimeout = properties.getInt(PropertyKeys.OPERATION_TIMEOUT);
    }
    return poll(currentPollTimeout);
}
 
Example 3
Source File: LocalMessageCache.java    From rocketmq-4.3.0 with Apache License 2.0 5 votes vote down vote up
MessageExt poll(final KeyValue properties) {
    int currentPollTimeout = clientConfig.getOperationTimeout();
    if (properties.containsKey(Message.BuiltinKeys.TIMEOUT)) {
        currentPollTimeout = properties.getInt(Message.BuiltinKeys.TIMEOUT);
    }
    return poll(currentPollTimeout);
}
 
Example 4
Source File: MysqlConnector.java    From openmessaging-connect-odar with Apache License 2.0 5 votes vote down vote up
@Override
public String verifyAndSetConfig(KeyValue config) {

    for(String requestKey : Config.REQUEST_CONFIG){
        if(!config.containsKey(requestKey)){
            return "Request config key: " + requestKey;
        }
    }
    this.config = config;
    return "";
}
 
Example 5
Source File: LocalMessageCache.java    From rocketmq-read with Apache License 2.0 5 votes vote down vote up
MessageExt poll(final KeyValue properties) {
    int currentPollTimeout = clientConfig.getOperationTimeout();
    if (properties.containsKey(Message.BuiltinKeys.TIMEOUT)) {
        currentPollTimeout = properties.getInt(Message.BuiltinKeys.TIMEOUT);
    }
    return poll(currentPollTimeout);
}
 
Example 6
Source File: LocalMessageCache.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
MessageExt poll(final KeyValue properties) {
    int currentPollTimeout = clientConfig.getOmsOperationTimeout();
    if (properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)) {
        currentPollTimeout = properties.getInt(PropertyKeys.OPERATION_TIMEOUT);
    }
    return poll(currentPollTimeout);
}
 
Example 7
Source File: KeyValueHelper.java    From joyqueue with Apache License 2.0 4 votes vote down vote up
public static int getInt(KeyValue keyValue, String key, int defaultValue) {
    if (!keyValue.containsKey(key)) {
        return defaultValue;
    }
    return keyValue.getInt(key);
}
 
Example 8
Source File: ProducerImpl.java    From rocketmq with Apache License 2.0 4 votes vote down vote up
@Override
public SendResult send(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(Message.BuiltinKeys.TIMEOUT)
        ? properties.getInt(Message.BuiltinKeys.TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return send(message, timeout);
}
 
Example 9
Source File: MessagingAccessPointAdapter.java    From openmessaging-java with Apache License 2.0 4 votes vote down vote up
private static String parseDriverImpl(String driverType, KeyValue attributes) {
    if (attributes.containsKey(OMSBuiltinKeys.DRIVER_IMPL)) {
        return attributes.getString(OMSBuiltinKeys.DRIVER_IMPL);
    }
    return "io.openmessaging." + driverType + ".MessagingAccessPointImpl";
}
 
Example 10
Source File: ProducerImpl.java    From rocketmq with Apache License 2.0 4 votes vote down vote up
@Override
public Promise<SendResult> sendAsync(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(Message.BuiltinKeys.TIMEOUT)
        ? properties.getInt(Message.BuiltinKeys.TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return sendAsync(message, timeout);
}
 
Example 11
Source File: ProducerImpl.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 4 votes vote down vote up
@Override
public SendResult send(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)
        ? properties.getInt(PropertyKeys.OPERATION_TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return send(message, timeout);
}
 
Example 12
Source File: ProducerImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public Promise<SendResult> sendAsync(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)
        ? properties.getInt(PropertyKeys.OPERATION_TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return sendAsync(message, timeout);
}
 
Example 13
Source File: ProducerImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public SendResult send(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)
        ? properties.getInt(PropertyKeys.OPERATION_TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return send(message, timeout);
}
 
Example 14
Source File: KeyValueHelper.java    From joyqueue with Apache License 2.0 4 votes vote down vote up
public static String getString(KeyValue keyValue, String key, String defaultValue) {
    if (!keyValue.containsKey(key)) {
        return defaultValue;
    }
    return keyValue.getString(key);
}
 
Example 15
Source File: ProducerImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public SendResult send(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)
        ? properties.getInt(PropertyKeys.OPERATION_TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return send(message, timeout);
}
 
Example 16
Source File: ProducerImpl.java    From rocketmq-read with Apache License 2.0 4 votes vote down vote up
@Override
public Promise<SendResult> sendAsync(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(Message.BuiltinKeys.TIMEOUT)
        ? properties.getInt(Message.BuiltinKeys.TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return sendAsync(message, timeout);
}
 
Example 17
Source File: ProducerImpl.java    From rocketmq-read with Apache License 2.0 4 votes vote down vote up
@Override
public SendResult send(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(Message.BuiltinKeys.TIMEOUT)
        ? properties.getInt(Message.BuiltinKeys.TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return send(message, timeout);
}
 
Example 18
Source File: ProducerImpl.java    From rocketmq-4.3.0 with Apache License 2.0 4 votes vote down vote up
@Override
public Promise<SendResult> sendAsync(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(Message.BuiltinKeys.TIMEOUT)
        ? properties.getInt(Message.BuiltinKeys.TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return sendAsync(message, timeout);
}
 
Example 19
Source File: ProducerImpl.java    From rocketmq-4.3.0 with Apache License 2.0 4 votes vote down vote up
@Override
public SendResult send(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(Message.BuiltinKeys.TIMEOUT)
        ? properties.getInt(Message.BuiltinKeys.TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return send(message, timeout);
}
 
Example 20
Source File: ProducerImpl.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public Promise<SendResult> sendAsync(final Message message, final KeyValue properties) {
    long timeout = properties.containsKey(PropertyKeys.OPERATION_TIMEOUT)
        ? properties.getInt(PropertyKeys.OPERATION_TIMEOUT) : this.rocketmqProducer.getSendMsgTimeout();
    return sendAsync(message, timeout);
}