Parameterize a queue name in a reader


We have a custom type which reads the location of an input measurement streamed file from an AS SQS Queu, as follows
@queue(name=“OriginC3StreamingDataQueue”, doNotUpsertQueue=true)
type WellStreamMeasurementReader mixes QueueInboundMessage {
receiveBatch: ~ js server

This worked great as a POC in a predev environment where we could hard-code some7.8-specific features (like the queue name) to get it to work, but for each environment (prod, QA, etc.), we have a different SQS queue (queue names must be globally unique) that is to be used. There will also be multiple types that are streamed and each type will use a different queue, Canonical, destination, transformation, etc.

So as to be able to migrate / provision the code to production without hard-coded queue names, I configured a new value in TenantConfig as follows

I then want the value of the TenantConfig.StreamMeasureQueue to populate the queue name in the first code (type declaration).

How do I parameterise this value so the type populates with the value OriginC3ProdStreamPiNumQ into the @queue(name) property?



Per @rohit.sureka, this feature is not currently implemented.



Update: this feature has been refactored, the queue names are part of configuration framework now. The above approach is no longer valid.



@yaroslav Can you provide the new way to subscribe to queues please?


#5 which types should they now be looking at?



@NabilKoroghli if you have a type that mixes QueueInboundMessage, it can be configured with a queueName, kind (queue kind), and subscribe (true/false). See documentation for QueueInboundMessage in C3Docs. For example:

FooType mixes QueueInboundMessage
var config = FooType.make().getConfig();
config.queueName =
config.kind = ‘sqs’
config.subscribe = true

After this has been done, your new type will start processing inbound SQS messages.

1 Like

#7, I see only kind and queueName properties but not subscribe. We are on c3-server-