- QueueChannel - Most basic one, receiver has to call the 'receive' method with timeout optionally
- PriorityChannel - Allows the endpoint to receive messages in a specified priority.
- RendezvousChannel - Sender will be bloqued until the receiver retrieves the msg from the channel
- DirectChannel (default) - Push messages but only one receiver can obtain the message - handleMessage will be perfomed within the sender's thread before send() method returns. Transactional
- ExecutorChannel - Similar to DirectChannel, but dispatching of the message happends in an instance of TaskExecutor (different to sender's thread), so no transactional support.
- NullChannel - Used for testing, send() method returns TRUE and receive() method always null.
This file contains hidden or 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
# Deploying a Sinatra app to Heroku | |
## Database | |
The location of the database Heroku provides can be found in the environment | |
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example | |
on how to use this. | |
## Server | |
Heroku is serving your apps with thin, with means you have all your thin goodness available, | |
such as EventMachine. |
This file contains hidden or 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
package directlabs.integration; | |
import java.util.Date; | |
import java.util.concurrent.TimeUnit; | |
import org.springframework.scheduling.Trigger; | |
import org.springframework.scheduling.TriggerContext; | |
import org.springframework.util.Assert; | |
/** |
This file contains hidden or 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
package directlabs.extra; | |
import java.io.StringWriter; | |
import java.io.Writer; | |
import org.codehaus.jackson.map.ObjectMapper; | |
import org.springframework.util.Assert; | |
/** | |
* The two most used utility methods to convert Java Pojos from/to Json. |
This file contains hidden or 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
package directlabs.experimental; | |
import org.apache.commons.lang.exception.ExceptionUtils; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.FSDataOutputStream; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.fs.Path; | |
import org.springframework.integration.Message; | |
import org.springframework.integration.handler.AbstractMessageHandler; | |
import org.springframework.util.Assert; |
This file contains hidden or 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
META-INF/spring.handlers | |
------------------------ | |
http\://jteso.com/schema/integration=directlabs.experimental.springintegration.customadapters.outbound.config.TerminalMessagingNamespaceHandler | |
META-INF/spring.schemas | |
----------------------- | |
http\://jteso.com/schema/integration/jteso-integration-1.0.xsd=directlabs/experimental/springintegration/customadapters/outbound/config/jteso-integration-1.0.xsd | |
This file contains hidden or 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
package springapp.test; | |
import java.io.IOException; | |
import org.apache.commons.httpclient.Header; | |
import org.apache.commons.httpclient.HttpClient; | |
import org.apache.commons.httpclient.HttpException; | |
import org.apache.commons.httpclient.methods.GetMethod; |
This file contains hidden or 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
package com.jteso.hadoop.contrib.inputformat; | |
import java.io.IOException; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.BytesWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.InputSplit; | |
import org.apache.hadoop.mapreduce.RecordReader; | |
import org.apache.hadoop.mapreduce.TaskAttemptContext; |
This file contains hidden or 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
function updateElementIndex(el, prefix, ndx) { | |
var id_regex = new RegExp('(' + prefix + '-\\d+)'); | |
var replacement = prefix + '-' + ndx; | |
if ($(el).attr("for")) $(el).attr("for", $(el).attr("for").replace(id_regex, replacement)); | |
if (el.id) el.id = el.id.replace(id_regex, replacement); | |
if (el.name) el.name = el.name.replace(id_regex, replacement); | |
} | |
function addForm(btn, prefix) { | |
var formCount = parseInt($('#id_' + prefix + '-TOTAL_FORMS').val()); |
This file contains hidden or 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
from django.conf import settings | |
from django.http import HttpResponseRedirect | |
import re | |
class RequireLoginMiddleware(object): | |
def __init__(self): | |
self.urls = tuple([re.compile(url) for url in settings.LOGIN_REQUIRED_URLS]) | |
self.require_login_path = getattr(settings, 'LOGIN_URL', '/accounts/login/') | |
OlderNewer