Im trying to figure out how to use a sftp endpoint in a flow where the properties are dynamic depending on some incoming variable.
So the flow is basically like this:

```
<flow name="dynamicSftpEndpoint">
    <sftp:inbound-endpoint name="inbound" connector-ref="SFTP"
                           host="#[sftpHost]" port="#[sftpPort]"
                           user="#[sftpUser]" password="#[sftpPassword]"
                           archiveDir="#[sftpInboundArchive]"
                           responseTimeout="${sftp.responseTimeout}"
                           path="#[sftpInboundPath]">
        <file:filename-regex-filter pattern="#[sftpInboundPattern]" caseSensitive="false"/>
    </sftp:inbound-endpoint>
    <set-variable variableName="filename" value="#[message.inboundProperties.originalFilename]"/>
    <log:info message="File '#[filename]' received from endpoint #[market]"/>
</flow>

```

But I get an exception like

```
Caused by: org.mule.api.endpoint.MalformedEndpointException: The endpoint "sftp://#[sftpUser]:#[sftpPassword]@#[sftpHost]:#[sftpPort]/#[sftpInboundPath]" is malformed and cannot be parsed.  If this is the name of a global endpoint, check the name is correct, that the endpoint exists, and that you are using the correct configuration (eg the "ref" attribute).  Note that names on inbound and outbound endpoints cannot be used to send or receive messages; use a named global endpoint instead.. Only Outbound endpoints can be dynamic

```

I noticed the last sentence there that only outbound endpoint can be dynamic. But does anyone have an idea on a workaround for dynamic inbound endpoints as well?

Thanks