def create_subscription(self, query=None, exchange_name='', name='', description='', exchange_point=''):
        '''
        @brief Create a new subscription. The id string returned is the ID of the new subscription
        in the resource registry.
        @param query is a subscription query object (Stream Query, Exchange Query, etc...)
        @param exchange_name is the name (queue) where messages will be delivered for this subscription
        @param name (optional) is the name of the subscription
        @param description (optional) is the description of the subscription

        @param query    Unknown
        @param exchange_name    str
        @param name    str
        @param description    str
        @retval subscription_id    str
        @throws BadRequestError    Throws when the subscription query object type is not found
        '''
        log.debug("Creating subscription object")
        subscription = Subscription(name, description=description)
        subscription.exchange_name = exchange_name
        subscription.exchange_point = exchange_point or 'science_data'
        subscription.query = query
        if isinstance(query, StreamQuery):
            subscription.subscription_type = SubscriptionTypeEnum.STREAM_QUERY
        elif isinstance(query, ExchangeQuery):
            subscription.subscription_type = SubscriptionTypeEnum.EXCHANGE_QUERY
        else:
            raise BadRequest("Query type does not exist")

        subscription_id, _ = self.clients.resource_registry.create(subscription)

        #we need the stream_id to create the association between the
        #subscription and stream.
        if subscription.subscription_type == SubscriptionTypeEnum.STREAM_QUERY:
            for stream_id in subscription.query.stream_ids:
                self.clients.resource_registry.create_association(subscription_id, PRED.hasStream, stream_id)

        return subscription_id