Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bazaarvoice/awslocal
Partial implementation of AWS Java SDK that operates locally
https://github.com/bazaarvoice/awslocal
Last synced: 2 months ago
JSON representation
Partial implementation of AWS Java SDK that operates locally
- Host: GitHub
- URL: https://github.com/bazaarvoice/awslocal
- Owner: bazaarvoice
- License: apache-2.0
- Created: 2013-07-18T17:08:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-07-13T05:33:57.000Z (over 4 years ago)
- Last Synced: 2023-12-20T09:31:41.949Z (about 1 year ago)
- Language: Java
- Size: 67.4 KB
- Stars: 5
- Watchers: 36
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
awslocal
========Implements some of the AWS Java SDK interfaces so that they can work entirely on the local machine.
Which interfaces?
-----------------
Currently, this implements:
- SQS queues, by representing queues as directories and messages as files.
- SNS, but only with the SQS protocol (it represents the topics in memory, and it takes an AmazonSQS implementation to send to SQS protocol subscriptions).Using it
--------
This library is built in Java 7.
- SQS:```java
AmazonSQS sqsClient = new DirectorySQS("")
```Then just use sqsClient just as the SDK specifies - create queues and send messages!
- SNS:```java
AmazonSNS snsClient = new InMemorySNS()
```Again, use it as if it were SNS; subscribe queues to topics, and broadcast to those topics! Note that topics only exist for a specific InMemorySNS.
```java
AmazonSQS sqs = new DirectorySQS(directory);
AmazonSNS sns = new InMemorySNS(sqs);String topicName = "topicName";
String queueName = "queueName";
CreateTopicResult topicResult = sns.createTopic(new CreateTopicRequest(topicName));
CreateQueueResult queueResult = sqs.createQueue(new CreateQueueRequest(queueName));
GetQueueAttributesResult queueAttributesResult = sqs.getQueueAttributes(new GetQueueAttributesRequest(queueResult.getQueueUrl()).withAttributeNames("QueueArn"));
sns.subscribe(new SubscribeRequest(topicResult.getTopicArn(), "sqs", queueAttributesResult.getAttributes().get("QueueArn")));
```
See the tests for further examples of use.Further development
--------------------
These implementations have been tested fairly thoroughly, so you should be able to rely on them for testing projects that use SNS and SQS.
We (Robby and Aidan) haven't needed any other interfaces implemented yet, so we don't have plans to add more stuff.
However, if you find any bugs, please do open a ticket, and we'll see what we can do!
If you want to add implementations for further interfaces, send us a pull request and we'll take a look.Licensing
---------
See the LICENSE file.