camel icon indicating copy to clipboard operation
camel copied to clipboard

Align properties for camel infra command

Open Croway opened this issue 6 months ago • 2 comments

$ camel infra run rabbitmq --json
{
  "connectionProperties" : { },
  "getAmqpUrl" : "amqp://localhost:5672",
  "getHttpPort" : 15672,
  "initialize" : null,
  "managementPassword" : "guest",
  "managementUri" : "http://localhost:15672",
  "managementUsername" : "guest",
  "shutdown" : null,
  "uri" : "amqp://localhost:5672"
}
        CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
        cachingConnectionFactory.setUri("amqp://localhost:5672");
        getCamelContext().getRegistry().bind("rabbitConnectionFactory", cachingConnectionFactory);

        from("timer:java?period=1000")
                .setBody()
                .simple("Hello Camel from ${routeId}")
                .to("spring-rabbitmq:cheese?routingKey=cheese");

        from("spring-rabbitmq:cheese?routingKey=cheese")
                .log("${body}");

The Management GUI is accessible at managementUri, and managementUsername and managementPassword can be used to log in to it.

Croway avatar Jun 12 '25 12:06 Croway

$ camel infra run kafka --json
{
  "brokers" : "localhost:9092",
  "getBootstrapServers" : "localhost:9092"
}
- route:
    id: route-8109
    from:
      uri: timer:yaml
      parameters:
        period: "1000"
      steps:
        - setBody:
            simple: Hello Camel from ${routeId}
        - to:
            id: to-1494
            uri: kafka
            parameters:
              brokers: localhost:9092
              topic: cheese
- route:
    id: route-4039
    from:
      id: from-1758
      uri: kafka
      parameters:
        brokers: localhost:9092
        topic: cheese
      steps:
        - log:
            id: log-1871
            message: ${body}

Croway avatar Jun 12 '25 13:06 Croway

$ camel infra run sftp --json
{
  "directoryName" : "myTestDirectory",
  "getFtpRootDir" : "file:///Users/fmariani/Repositories/croway/camel/target/ftp/camel-test-infra-test-directory/res/home",
  "getPort" : 2222,
  "host" : "localhost",
  "hostname" : "localhost",
  "password" : "admin",
  "port" : 2222,
  "username" : "admin"
}
- route:
    id: route-1271
    from:
      uri: timer:yaml
      parameters:
        period: "1000"
      steps:
        - setBody:
            simple: Hello Camel from ${routeId}
        - to:
            id: to-1276
            uri: ftp
            parameters:
              directoryName: myTestDirectory
              host: localhost
              password: admin
              port: 2221
              username: admin
- route:
    id: route-2332
    autoStartup: true
    from:
      id: from-3038
      uri: ftp
      parameters:
        directoryName: myTestDirectory
        host: localhost
        password: admin
        port: 2221
        username: admin
      steps:
        - log:
            id: log-2189
            message: ${body}

Croway avatar Jun 12 '25 14:06 Croway

how many are there still left to be done ?

davsclaus avatar Jun 25 '25 08:06 davsclaus

how many are there still left to be done ?

I am sorry for taking so long, 2 more to go I'll be done by today or tomorrow

Croway avatar Jun 25 '25 08:06 Croway

Oh that is great that you can see the finish line. I thought maybe 20+ was still pending.

davsclaus avatar Jun 25 '25 09:06 davsclaus

$ camel infra run milvus --json
{
  "getMilvusEndpointUrl" : "http://localhost:19530",
  "getMilvusHost" : "localhost",
  "getMilvusPort" : 19530,
  "host" : "localhost",
  "port" : 19530
}
from("timer:java?period=1000")
                .to("direct:in");

        FieldType fieldType1 = FieldType.newBuilder()
                .withName("userID")
                .withDescription("user identification")
                .withDataType(DataType.Array.Int64)
                .withPrimaryKey(true)
                .withAutoID(true)
                .build();

        FieldType fieldType2 = FieldType.newBuilder()
                .withName("userFace")
                .withDescription("face embedding")
                .withDataType(DataType.FloatVector)
                .withDimension(64)
                .build();

        FieldType fieldType3 = FieldType.newBuilder()
                .withName("userAge")
                .withDescription("user age")
                .withDataType(DataType.Int8)
                .build();

        from("direct:in?host=localhost&port=19530")
                .setHeader(Milvus.Headers.ACTION)
                .constant(MilvusAction.CREATE_COLLECTION)
                .setBody()
                .constant(
                        CreateCollectionParam.newBuilder()
                                .withCollectionName("test")
                                .withDescription("customer info")
                                .withShardsNum(2)
                                .withEnableDynamicField(false)
                                .addFieldType(fieldType1)
                                .addFieldType(fieldType2)
                                .addFieldType(fieldType3)
                                .build())
                .to("milvus:test")
                .log("${body}");

Croway avatar Jun 25 '25 09:06 Croway

$ camel infra run qdrant --json
{
  "getGrpcHost" : "localhost",
  "getGrpcPort" : 6334,
  "getHttpHost" : "localhost",
  "getHttpPort" : 6333,
  "host" : "localhost",
  "port" : 6334
}
from("timer:java?period=1000&includeMetadata=true")
                .choice().when(exchangeProperty("CamelTimerCounter").isEqualTo(1))
                    .to("direct:create")
                .otherwise()
                    .to("direct:upsert");

        from("direct:create")
                .setHeader(Qdrant.Headers.ACTION)
                    .constant(QdrantAction.CREATE_COLLECTION)
                .setBody()
                .constant(
                        Collections.VectorParams.newBuilder()
                                .setSize(2)
                                .setDistance(Collections.Distance.Cosine).build())
                .to("qdrant:myCollection?host=localhost&port=6334")
                .log("${body}");

        JsonWithInt.Value.Builder hello = JsonWithInt.Value.newBuilder();
        hello.setStringValue("hello");

        JsonWithInt.Value.Builder number = JsonWithInt.Value.newBuilder();
        number.setIntegerValue(1);

        from("direct:upsert")
                .setHeader(Qdrant.Headers.ACTION)
                .constant(QdrantAction.UPSERT)
                .setBody()
                .constant(
                        Points.PointStruct.newBuilder()
                                .setId(PointIdFactory.id(8))
                                .setVectors(VectorsFactory.vectors(List.of(3.5f, 4.5f)))
                                .putAllPayload(Map.of(
                                        "foo", hello.build(),
                                        "bar", number.build()))
                                .build())
                .to("qdrant:myCollection?host=localhost&port=6334")
                .log("${body}");

Croway avatar Jun 25 '25 11:06 Croway

oh great is all of this done and this PR is ready to merge ?

davsclaus avatar Jun 26 '25 07:06 davsclaus

@davsclaus done, the failure is related to mvnd, I'll merge it.

Croway avatar Jun 26 '25 09:06 Croway