Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

The yammer component can be configured with the Yammer account settings which are mandatory to configure before using. You can also configure these options directly in the endpoint.

Div
classconfluenceTableSmall

Option

Description

consumerKey

The consumer key

consumerSecret

The consumer secret

accessToken

The access token

Wiki Markup
{div:class=confluenceTableSmall} || Option || Description || | consumerKey | The consumer key | | consumerSecret | The consumer secret | | accessToken | The access token | {div}

Consuming messages

The camel-yammer component provides several endpoints for consuming messages:

Div
classconfluenceTableSmall
Wiki Markup
{div:class=confluenceTableSmall} || URI || Description || | {code}

URI

Description

Code Block
yammer:messages?[
options]{code} | All public messages in the
options]

All public messages in the user's

(whose

access

token

is

being

used

to

make

the

API

call)

Yammer

network.

Corresponds

to

"All"

conversations

in

the

Yammer

web

interface.

| | {code}

Code Block
yammer:my_feed?[options]
{code} | The

The user's

feed,

based

on

the

selection

they

have

made

between

"Following"

and

"Top"

conversations.

| | {code}

Code Block
yammer:algo?[options]
{code} | The algorithmic feed for the user that corresponds to

The algorithmic feed for the user that corresponds to "Top"

conversations,

which

is

what

the

vast

majority

of

users

will

see

in

the

Yammer

web

interface.

| | {code}

Code Block
yammer:following?[options
]{code} | The
]

The "Following"

feed

which

is

conversations

involving

people,

groups

and

topics

that

the

user

is

following.

| | {code}

Code Block
yammer:sent?[options]
{code} | All messages sent by the user. | | {code}

All messages sent by the user.

Code Block
yammer:private?[options]
{code} | Private messages received by the user. | | {code}

Private messages received by the user.

Code Block
yammer:received?[options]
{code} | *Camel

Camel 2.12.1:

*

All

messages

received

by

the

user

| {div}

URI Options for consuming messages

Div
classconfluenceTableSmall

Name

Default Value

Description

useJson

false

Set to true if you want to use raw JSON rather than converting to POJOs.

delay

5000

in milliseconds

consumerKey

null

Consumer Key. Can also be configured on the YammerComponent level instead.

consumerSecret

null

Consumer Secret. Can also be configured on the YammerComponent level instead.

accessToken

null

Access Token. Can also be configured on the YammerComponent level instead.

limit

-1

Return only the specified number of messages. Works for threaded=true and threaded=extended.

threaded

null

threaded=true will only return the first message in each thread. This parameter is intended for apps which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on the Yammer web interface.

olderThan

-1

Returns messages older than the message ID specified as a numeric string. This is useful for paginating messages. For example, if you're currently viewing 20 messages and the oldest is number 2912, you could append "?olderThan=2912″ to your request to get the 20 messages prior to those you're seeing.

newerThan

-1

Returns messages newer than the message ID specified as a numeric string. This should be used when polling for new messages. If you're looking at messages, and the most recent message returned is 3516, you can make a request with the parameter "?newerThan=3516″ to ensure that you do not get duplicate copies of messages already on your page.

Wiki Markup
{div:class=confluenceTableSmall} || Name || Default Value || Description || | useJson | {{false}} | Set to true if you want to use raw JSON rather than converting to POJOs. | | delay | {{5000}} | in milliseconds | | consumerKey | {{null}} | Consumer Key. Can also be configured on the {{YammerComponent}} level instead. | | consumerSecret | {{null}} | Consumer Secret. Can also be configured on the {{YammerComponent}} level instead. | | accessToken | {{null}} | Access Token. Can also be configured on the {{YammerComponent}} level instead. | | limit | {{-1}} | Return only the specified number of messages. Works for threaded=true and threaded=extended. | | threaded | {{null}} | threaded=true will only return the first message in each thread. This parameter is intended for apps which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages, as they are viewed in the default view on the Yammer web interface. | | olderThan | {{-1}} | Returns messages older than the message ID specified as a numeric string. This is useful for paginating messages. For example, if you're currently viewing 20 messages and the oldest is number 2912, you could append "?olderThan=2912″ to your request to get the 20 messages prior to those you're seeing. | | newerThan| {{-1}} | Returns messages newer than the message ID specified as a numeric string. This should be used when polling for new messages. If you're looking at messages, and the most recent message returned is 3516, you can make a request with the parameter "?newerThan=3516″ to ensure that you do not get duplicate copies of messages already on your page. | {div}

Message format

All messages by default are converted to a POJO model provided in the org.apache.camel.component.yammer.model package. The original message coming from yammer is in JSON. For all message consuming & producing endpoints, a Messages object is returned. Take for example a route like:

...

URI Options for retrieving relationships

...

{:
Div
classconfluenceTableSmall

Name

Default Value

Description

useJson

false

Set to true if you want to use raw JSON rather than converting to POJOs.

delay

5000

in milliseconds

consumerKey

null

Consumer Key. Can also be configured on the YammerComponent level instead.

consumerSecret

null

Consumer Secret. Can also be configured on the YammerComponent level instead.

accessToken

null

Access Token. Can also be configured on the YammerComponent level instead.

userId

current user

To view the relationships for a user other than the current user.

=confluenceTableSmall} || Name || Default Value || Description || | useJson | {{false}} | Set to true if you want to use raw JSON rather than converting to POJOs. | | delay | {{5000}} | in milliseconds | | consumerKey | {{null}} | Consumer Key. Can also be configured on the {{YammerComponent}} level instead. | | consumerSecret | {{null}} | Consumer Secret. Can also be configured on the {{YammerComponent}} level instead. | | accessToken | {{null}} | Access Token. Can also be configured on the {{YammerComponent}} level instead. | | userId | {{current user}} | To view the relationships for a user other than the current user. | {div}

Retrieving users

The camel-yammer component provides several endpoints for retrieving users:

Div
classconfluenceTableSmall
Wiki Markup
{div:class=confluenceTableSmall} || URI || Description || | {code}

URI

Description

Code Block
yammer:users?[options]
{code} | Retrieve users in the current

Retrieve users in the current user's

Yammer

network.

| | {code}

Code Block
yammer:current?[options]
{code} | View data about the current user. | {div}

View data about the current user.

URI Options for retrieving users

...

{:
Div
classconfluenceTableSmall

Name

Default Value

Description

useJson

false

Set to true if you want to use raw JSON rather than converting to POJOs.

delay

5000

in milliseconds

consumerKey

null

Consumer Key. Can also be configured on the YammerComponent level instead.

consumerSecret

null

Consumer Secret. Can also be configured on the YammerComponent level instead.

accessToken

null

Access Token. Can also be configured on the YammerComponent level instead.

=confluenceTableSmall} || Name || Default Value || Description || | useJson | {{false}} | Set to true if you want to use raw JSON rather than converting to POJOs. | | delay | {{5000}} | in milliseconds | | consumerKey | {{null}} | Consumer Key. Can also be configured on the {{YammerComponent}} level instead. | | consumerSecret | {{null}} | Consumer Secret. Can also be configured on the {{YammerComponent}} level instead. | | accessToken | {{null}} | Access Token. Can also be configured on the {{YammerComponent}} level instead. | {div}

Using an enricher

It is helpful sometimes (or maybe always in the case of users or relationship consumers) to use an enricher pattern rather than a route initiated with one of the polling consumers in camel-yammer. This is because the consumers will fire repeatedly, however often you set the delay for. If you just want to look up a user's data, or grab a message at a point in time, it is better to call that consumer once and then get one with your route.

...