Ну после некоторых тестов я прочитал этот параметр в настройке Camel
bridgeEndpoint Default:false Camel 2.16.0: If bridgeEndpoint is true, the producer will ignore the topic header setting of the message.
Итак, я даю кадр для добавления в мои конечные точки
<!--DEFINE KAFKA'S TOPCIS AS ENDPOINT-->
<endpoint id="tagBlink" uri="kafka:10.0.0.165:9092">
<property key="topic" value="tagBlink"/>
<property key="topic" value="tagBlink"/>
<property key="brokers" value="10.0.0.165:9092"/>
<property key="bridgeEndpoint " value="true"/>
</endpoint>
<!--END OF KAFKA'S TOPICS's AS ENDPOINT-->
<endpoint id="testMike" uri="kafka:10.0.0.165:9092">
<property key="topic" value="testMike"/>
<property key="brokers" value="10.0.0.165:9092"/>
<property key="bridgeEndpoint " value="true"/>
</endpoint>
И бесконечный цикл остановлен ,
Вы отправляете append()
несколько аргументов, а не строку. Отформатируйте аргумент как строку как таковую. Кроме того, random.choice()
является лучшим подходом, чем random.randint()
здесь, как указано: @JaSON ниже.
3.6+ с использованием f-strings
yourCards.append(f"{random.choice(cards)} of {random.choice(suites)}")
Используя .format()
yourCards.append("{} of {}".format(random.choice(cards), random.choice(suites)))
конкатенацию строк [1117 ]
yourCards.append(str(random.choice(cards)) + " of " + str(random.choice(suites)))
#You likely don't need the str() but it's just a precaution
Улучшение подхода join()
Алекса
' of '.join([random.choice(cards), random.choice(suites)])
yourCards.append(' '.join([random.choice(cards), "of", random.choice(suits)]))