我有一个端点,它接受自动递增的整数id作为路径参数的一部分,并且在请求正文中也有一些键也接受它。
例如端点为[2019-06-21 12:41:13,494] WARN [Producer clientId=console-producer] Got error produce response with correlation id 26 on topic-partition test-0, retrying (2 attempts left). Error: UNKNOWN_TOPIC_OR_PARTITION (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,495] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,597] WARN [Producer clientId=console-producer] Got error produce response with correlation id 28 on topic-partition test-0, retrying (1 attempts left). Error: UNKNOWN_TOPIC_OR_PARTITION (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,597] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,704] WARN [Producer clientId=console-producer] Got error produce response with correlation id 30 on topic-partition test-0, retrying (0 attempts left). Error: UNKNOWN_TOPIC_OR_PARTITION (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,704] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,808] ERROR Error when sending message to topic test with key: null, value: 0 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition.
[2019-06-21 12:41:13,809] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
身体是
http://foo.bar/{id}
我尝试直接使用{
"someid" : someno+{id passed in url},
"some world :"fixed string" + "id passed in url"
}
代替我的{id},但是它不起作用,并且在调试时发现它不能代替值,并且只能作为文字输入。
答案 0 :(得分:2)
答案 1 :(得分:2)
有__counter() function每次被调用时都会生成递增的数字,您可以将其声明放入URL中,例如:
${__counter(FALSE,counter)}
和对请求正文的JMeter Variable引用:
{
"someid" : someno+${counter},
"some world :"fixed string" + "id passed in url"
}
这样,您每次通话都会获得一个唯一的递增号码