INT-1603 removed MH prost processor from AMS
This commit is contained in:
@@ -53,7 +53,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public abstract class AbstractTwitterMessageSource<T> extends AbstractEndpoint
|
||||
implements MessageSource, TrackableComponent {
|
||||
implements MessageSource{
|
||||
|
||||
private volatile MetadataStore metadataStore;
|
||||
|
||||
@@ -73,16 +73,10 @@ public abstract class AbstractTwitterMessageSource<T> extends AbstractEndpoint
|
||||
|
||||
private volatile ScheduledFuture<?> twitterUpdatePollingTask;
|
||||
|
||||
private final HistoryWritingMessagePostProcessor historyWritingPostProcessor = new HistoryWritingMessagePostProcessor();
|
||||
|
||||
public AbstractTwitterMessageSource(TwitterOperations twitter){
|
||||
this.twitter = twitter;
|
||||
}
|
||||
|
||||
public void setShouldTrack(boolean shouldTrack) {
|
||||
this.historyWritingPostProcessor.setShouldTrack(shouldTrack);
|
||||
}
|
||||
|
||||
public long getMarkerId() {
|
||||
return this.markerId;
|
||||
}
|
||||
@@ -151,7 +145,6 @@ public abstract class AbstractTwitterMessageSource<T> extends AbstractEndpoint
|
||||
@Override
|
||||
protected void doStart(){
|
||||
Assert.notNull(this.twitter, "'twitter' instance can't be null");
|
||||
historyWritingPostProcessor.setTrackableComponent(this);
|
||||
// temporarily injecting Twitter into a trigger so it can deal with Rate Limits. will be changed
|
||||
// once we switch to Spring Social
|
||||
RateLimitStatusTrigger trigger = new RateLimitStatusTrigger(this.twitter.getUnderlyingTwitter());
|
||||
|
||||
@@ -27,32 +27,32 @@
|
||||
<channel id="inbound_updates"/>
|
||||
<channel id="inbound_search"/>
|
||||
|
||||
<beans:bean id="twitterTemplate" class="org.springframework.integration.twitter.core.Twitter4jTemplate">
|
||||
<beans:constructor-arg value="${twitter.oauth.consumerKey}"/>
|
||||
<beans:constructor-arg value="${twitter.oauth.consumerSecret}"/>
|
||||
<beans:constructor-arg value="${twitter.oauth.accessToken}"/>
|
||||
<beans:constructor-arg value="${twitter.oauth.accessTokenSecret}"/>
|
||||
</beans:bean>
|
||||
<!-- <beans:bean id="twitterTemplate" class="org.springframework.integration.twitter.core.Twitter4jTemplate">-->
|
||||
<!-- <beans:constructor-arg value="${twitter.oauth.consumerKey}"/>-->
|
||||
<!-- <beans:constructor-arg value="${twitter.oauth.consumerSecret}"/>-->
|
||||
<!-- <beans:constructor-arg value="${twitter.oauth.accessToken}"/>-->
|
||||
<!-- <beans:constructor-arg value="${twitter.oauth.accessTokenSecret}"/>-->
|
||||
<!-- </beans:bean>-->
|
||||
|
||||
<twitter:mentions-inbound-channel-adapter twitter-template="twitterTemplate" channel="inbound_mentions">
|
||||
<poller fixed-rate="5000" max-messages-per-poll="3"/>
|
||||
</twitter:mentions-inbound-channel-adapter>
|
||||
<service-activator input-channel="inbound_mentions" ref="twitterAnnouncer" method="mention"/>
|
||||
<!-- <twitter:mentions-inbound-channel-adapter twitter-template="twitterTemplate" channel="inbound_mentions">-->
|
||||
<!-- <poller fixed-rate="5000" max-messages-per-poll="3"/>-->
|
||||
<!-- </twitter:mentions-inbound-channel-adapter>-->
|
||||
<!-- <service-activator input-channel="inbound_mentions" ref="twitterAnnouncer" method="mention"/>-->
|
||||
|
||||
<twitter:dm-inbound-channel-adapter twitter-template="twitterTemplate" channel="inbound_dm">
|
||||
<poller fixed-rate="5000" max-messages-per-poll="3"/>
|
||||
</twitter:dm-inbound-channel-adapter>
|
||||
<service-activator input-channel="inbound_dm" ref="twitterAnnouncer" method="dm"/>
|
||||
<!-- <twitter:dm-inbound-channel-adapter twitter-template="twitterTemplate" channel="inbound_dm">-->
|
||||
<!-- <poller fixed-rate="5000" max-messages-per-poll="3"/>-->
|
||||
<!-- </twitter:dm-inbound-channel-adapter>-->
|
||||
<!-- <service-activator input-channel="inbound_dm" ref="twitterAnnouncer" method="dm"/>-->
|
||||
|
||||
<twitter:search-inbound-channel-adapter channel="inbound_search" query="#springintegration">
|
||||
<twitter:search-inbound-channel-adapter id="searchAdapter" channel="inbound_search" query="#springintegration">
|
||||
<poller fixed-rate="5000" max-messages-per-poll="5"/>
|
||||
</twitter:search-inbound-channel-adapter>
|
||||
<service-activator input-channel="inbound_search" ref="twitterAnnouncer" method="search"/>
|
||||
|
||||
<twitter:inbound-channel-adapter id="twitterInbound" twitter-template="twitterTemplate" channel="inbound_updates">
|
||||
<poller fixed-rate="5000" max-messages-per-poll="3"/>
|
||||
</twitter:inbound-channel-adapter>
|
||||
<service-activator input-channel="inbound_updates" ref="twitterAnnouncer" method="updates"/>
|
||||
<!-- <twitter:inbound-channel-adapter id="twitterInbound" twitter-template="twitterTemplate" channel="inbound_updates">-->
|
||||
<!-- <poller fixed-rate="5000" max-messages-per-poll="3"/>-->
|
||||
<!-- </twitter:inbound-channel-adapter>-->
|
||||
<!-- <service-activator input-channel="inbound_updates" ref="twitterAnnouncer" method="updates"/>-->
|
||||
|
||||
<beans:bean id="twitterAnnouncer" class="org.springframework.integration.twitter.ignored.TwitterAnnouncer"/>
|
||||
</beans:beans>
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.integration.twitter.ignored;
|
||||
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.integration.twitter.core.Tweet;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -26,9 +28,13 @@ public class TwitterAnnouncer {
|
||||
directMessage.getFromUser() + " with text " + directMessage.getText());
|
||||
}
|
||||
|
||||
public void search(Tweet search) {
|
||||
public void search(Message search) {
|
||||
MessageHistory history = MessageHistory.read(search);
|
||||
System.out.println(history);
|
||||
Tweet tweet = (Tweet) search.getPayload();
|
||||
|
||||
System.out.println("A search item was received " +
|
||||
search.getCreatedAt() + " with text " + search.getText());
|
||||
tweet.getCreatedAt() + " with text " + tweet.getText());
|
||||
}
|
||||
|
||||
public void mention(Tweet s) {
|
||||
|
||||
Reference in New Issue
Block a user