@Override
		public void run() {
			while (running.get()) {
				try {
					readStream(twitter.getRestTemplate());
				}
				catch (HttpStatusCodeException sce) {
					if (sce.getStatusCode() == HttpStatus.UNAUTHORIZED) {
						logger.error("Twitter authentication failed: " + sce.getMessage());
						running.set(false);
					}
					else if (sce.getStatusCode() == HttpStatus.TOO_MANY_REQUESTS) {
						waitRateLimitBackoff();
					}
					else {
						waitHttpErrorBackoff();
					}
				}
				catch (Exception e) {
					logger.warn("Exception while reading stream.", e);
					waitLinearBackoff();
				}
			}
		}
Filter tweets by language or languages.
extensions/spring-xd-extension-twitter/src/main/java/org/springframework/integration/x/twitter/AbstractTwitterInboundChannelAdapter.java