tarantooltarantool-cartridge

How to create sharded-queue tube the right way?


Let's say we have Tarantool Cartridge based service, which stores posts made by users. When user makes a new post, it is inserted to corresponding space. Simultaneously into sharded-queue tube notify_friends is added task for notifying user friends about new post.

Question is about creation of tube notify_friends. Initially I planned to do that in init() method of the service role, but it causes error, because tube creation modifies clusterwide-config and it is being changed when init() runs. I could try creating tube at first task add request, but not sure if it's the best approach.


Solution

  • You can put it to "default config" of your app.

    Check it here: How to implement default config section for a custom Tarantool Cartridge role?