Register default SPI

On wildfly I had this:

        <spi name="emailSender">
                <!-- Allow to send emails with attachments with custom extension -->
                <default-provider>emailwithattachment</default-provider>
                <provider name="emailwithattachment" enabled="true">
                    <properties>
                        <property name="path" value="{{ keycloak_directory }}/themes"/>
                    </properties>
                </provider>
            </spi>

On quarkus I think I have to register like this:

bin/kc.sh build --spi-emailSender-provider=emailwithattachment

But doesn’t seem to work. I think it still used the “default” provider as default.

How to specify that “emailwithattachment” is now the default provider?

emailSender should evaluate to email-sender,
so the whole config param should be --spi-email-sender-provider=emailwithattachment

1 Like

Thanks :slight_smile:
Finally its registered, any chance you know how to specify the property?

1 Like

Solution for properties:

bin/kc.sh build --spi-email-sender-emailwithattachment-path=...

“path” is the name used in the Factory

@Override
    public void init(Config.Scope config) {
        this.path = config.get("path");
    }