Components/DB/DBConfigurableConsumer.php
protected function readMessage(EndpointInterface $endpoint)
    {
        $options = $endpoint->getOptions();
        $method = $options[NoSQLConfigurableProtocol::OPTION_METHOD];
        $config = $this->methodsConfiguration[$method];
        $steps = $config[ConfigurableConsumerInterface::CONFIG_QUERY_STEPS];

        $context = $this->getConfHelper()->createContext($options);

        try {
            $this->configurableStepsProvider->executeSteps($steps, $options, $context);

            $result = $this->getConfHelper()->resolve(
                $config[ConfigurableConsumerInterface::CONFIG_QUERY_RESULT],
                $context
            );
        } catch (NoResultsException $exception) {
            $result = null;
            if ($options[ConfigurableDbalProtocol::OPTION_STOP_ON_NO_RESULTS]) {
                $this->stop();
            }
        }

        if (null == $result) {
            return null;
        } elseif (is_array($result)) {
            $result = new SerializableArray($result);
        }

        $context = new Context([
            Context::FLOWS_VERSION => $this->getFlowsVersion(),
            Context::TRANSACTION_ID => uniqid('', true),
            Context::ORIGINAL_FROM => $endpoint->getURI(),
        ]);

        return $this->smartesbHelper->getMessageFactory()->createMessage($result, [], $context);
    }
protected function readMessage(EndpointInterface $endpoint)
    {
        $options = $endpoint->getOptions();
        $method = $options[NoSQLConfigurableProtocol::OPTION_METHOD];
        $config = $this->methodsConfiguration[$method];
        $steps = $config[ConfigurableConsumerInterface::CONFIG_QUERY_STEPS];

        $context = $this->getConfHelper()->createContext($options);

        try {
            $this->configurableStepsProvider->executeSteps($steps, $options, $context);

            $result = $this->getConfHelper()->resolve(
                $config[ConfigurableConsumerInterface::CONFIG_QUERY_RESULT],
                $context
            );
        } catch (NoResultsException $exception) {
            $result = null;
            if ($options[ConfigurableDbalProtocol::OPTION_STOP_ON_NO_RESULTS]) {
                $this->stop();
            }
        }

        if (null == $result) {
            return null;
        } elseif (is_array($result)) {
            $result = new SerializableArray($result);
        }

        $context = new Context([
            Context::FLOWS_VERSION => $this->getFlowsVersion(),
            Context::TRANSACTION_ID => uniqid('', true),
            Context::ORIGINAL_FROM => $endpoint->getURI(),
        ]);

        return $this->smartesbHelper->getMessageFactory()->createMessage($result, [], $context);
    }
protected function readMessage ( EndpointInterface $ endpoint ) { $ options = $ endpoint -> getOptions ( ) ; $ method = $ options [ NoSQLConfigurableProtocol :: OPTION_METHOD ] ; $ config = $ this -> methodsConfiguration [ $ method ] ; $ steps = $ config [ ConfigurableConsumerInterface :: CONFIG_QUERY_STEPS ] ; $ context = $ this -> getConfHelper ( ) -> createContext ( $ options ) ; try { $ this -> configurableStepsProvider -> executeSteps ( $ steps , $ options , $ context ) ; $ result = $ this -> getConfHelper ( ) -> resolve ( $ config [ ConfigurableConsumerInterface :: CONFIG_QUERY_RESULT ] , $ context ) ; } catch ( NoResultsException $ exception ) { $ result = null ; if ( $ options [ ConfigurableDbalProtocol :: OPTION_STOP_ON_NO_RESULTS ] ) { $ this -> stop ( ) ; } } if ( null == $ result ) { return null ; } elseif ( is_array ( $ result ) ) { $ result = new SerializableArray ( $ result ) ; } $ context = new Context ( [ Context :: FLOWS_VERSION => $ this -> getFlowsVersion ( ) , Context :: TRANSACTION_ID => uniqid ( '' , true ) , Context :: ORIGINAL_FROM => $ endpoint -> getURI ( ) , ] ) ; return $ this -> smartesbHelper -> getMessageFactory ( ) -> createMessage ( $ result , [ ] , $ context ) ; }
Reads a message from the NoSQL database executing the configured steps.

@param EndpointInterface $endpoint

@return \Smartbox\Integration\FrameworkBundle\Core\Messages\Message
Reads a message from the NoSQL database executing the configured steps .