Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gggeek
committed
Aug 31, 2015
1 parent
9d84e4a
commit 16c3d2e
Showing
6 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Kaliop\Queueing\Plugins\KinesisBundle\Adapter\Kinesis; | ||
|
||
use Kaliop\QueueingBundle\Queue\Queue; | ||
use Kaliop\QueueingBundle\Adapter\DriverInterface; | ||
use Symfony\Component\DependencyInjection\ContainerAware; | ||
|
||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
class Driver extends ContainerAware implements DriverInterface | ||
{ | ||
public function acceptMessage($message) | ||
{ | ||
} | ||
|
||
/** | ||
* @param ??? $message | ||
* @return \Kaliop\QueueingBundle\Queue\MessageInterface | ||
*/ | ||
public function decodeMessage($message) | ||
{ | ||
} | ||
|
||
/** | ||
* @param string $queueName | ||
* @return \Kaliop\QueueingBundle\Queue\MessageProducerInterface | ||
*/ | ||
public function getMessageProducer($queueName) | ||
{ | ||
return '???'; $this->container->get('old_sound_rabbit_mq.' . $queueName . '_producer'); | ||
} | ||
|
||
/** | ||
* @param string $queueName | ||
* @return \Kaliop\QueueingBundle\Queue\QueueManagerInterface | ||
*/ | ||
public function getQueueManager($queueName) | ||
{ | ||
$mgr = $this->container->get('kaliop_queueing.kinesis.queue_manager'); | ||
$mgr->setQueueName($queueName); | ||
return $mgr; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/** | ||
* User: gaetano.giunta | ||
* Date: 19/05/14 | ||
* Time: 19.08 | ||
*/ | ||
|
||
namespace Kaliop\Queueing\Plugins\KinesisBundle\Adapter\Kinesis; | ||
|
||
use Kaliop\QueueingBundle\Service\MessageProducer as BaseMessageProducer; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; | ||
use Symfony\Component\DependencyInjection\ContainerInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | ||
use Symfony\Component\Config\FileLocator; | ||
use InvalidArgumentException; | ||
use Kaliop\QueueingBundle\Queue\Queue; | ||
use Kaliop\QueueingBundle\Queue\QueueManagerInterface; | ||
|
||
/** | ||
* A class dedicated not really to sending messages to a queue, bur rather to sending control commands | ||
*/ | ||
class QueueManager /*extends BaseMessageProducer*/ implements ContainerAwareInterface, QueueManagerInterface | ||
{ | ||
protected $queue; | ||
protected $container; | ||
|
||
public function setContainer(ContainerInterface $container = null) | ||
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* @param string $queue | ||
*/ | ||
public function setQueueName($queue) | ||
{ | ||
$this->queue = $queue; | ||
} | ||
|
||
public function listActions() | ||
{ | ||
return array(/*'purge', 'delete', 'info', 'list'*/); | ||
} | ||
|
||
public function executeAction($action) | ||
{ | ||
/*switch ($action) { | ||
case 'purge': | ||
return $this->purgeQueue(); | ||
case 'delete': | ||
return $this->deleteQueue(); | ||
case 'info': | ||
return $this->queueInfo(); | ||
case 'list': | ||
return $this->listQueues(); | ||
default: | ||
throw new InvalidArgumentException("Action $action not supported"); | ||
}*/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Kaliop\Queueing\Plugins\KinesisBundle\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
use Symfony\Component\Yaml\Yaml; | ||
|
||
/** | ||
* This is the class that loads and manages your bundle configuration | ||
* | ||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html} | ||
*/ | ||
class KaliopQueueingPluginsKinesisExtension extends Extension | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
//$configuration = new Configuration(); | ||
//$config = $this->processConfiguration( $configuration, $configs ); | ||
|
||
$loader = new Loader\YamlFileLoader( $container, new FileLocator( __DIR__.'/../Resources/config' ) ); | ||
$loader->load( 'services.yml' ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Kaliop\Queueing\Plugins\KinesisBundle; | ||
|
||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
class KaliopQueueingPluginsKinesisBundle extends Bundle | ||
{ | ||
/*public function build(ContainerBuilder $container) | ||
{ | ||
parent::build($container); | ||
}*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
parameters: | ||
kaliop_queueing.driver.kinesis.class: Kaliop\Queueing\Plugins\KinesisBundle\Adapter\Kinesis\Driver | ||
kaliop_queueing.kinesis.queue_manager.class: Kaliop\Queueing\Plugins\KinesisBundle\Adapter\Kinesis\QueueManager | ||
|
||
services: | ||
kaliop_queueing.driver.kinesis: | ||
class: %kaliop_queueing.driver.kinesis.class% | ||
calls: | ||
- [ setContainer, [ @service_container ] ] | ||
tags: | ||
- { name: kaliop_queueing.driver, alias: kinesis } | ||
|
||
kaliop_queueing.kinesis.queue_manager: | ||
class: %kaliop_queueing.kinesis.queue_manager.class% | ||
#parent: kaliop_queueing.message_producer | ||
calls: | ||
- [ setContainer, [ @service_container ] ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "kaliop/queueingbundle-kinesis", | ||
"description": "Kaliop Queueing Bundle", | ||
"license": "GPL-2.0", | ||
"autoload": { | ||
"psr-4": { "Kaliop\\Queueing\\Plugins\\KinesisBundle\\": "" } | ||
}, | ||
"require": { | ||
"kaliop/queueingbundle": "*", | ||
"" | ||
} | ||
} |