```python
def encode(message):
    """
    Write a function that takes a message, and encodes in such a 
    way that it swaps case of all letters, replaces all vowels in 
    the message with the letter that appears 2 places ahead of that 
    vowel in the english alphabet. 
    Assume only letters. 
    
    Examples:
    >>> encode('test')
    'TGST'
    >>> encode('This is a message')
    'tHKS KS C MGSSCGG'
    """
    vowels = 'aeiouAEIOU'
    result = []
    for char in message:
        if char in vowels:
            # Swap case first
            swapped = char.swapcase()
            # Then replace with letter 2 places ahead
            # Find the position in alphabet
            lower_char = swapped.lower()
            # Get the letter 2 places ahead
            new_char = chr(ord(lower_char) + 2)
            # Preserve the swapped case
            if swapped.isupper():
                result.append(new_char.upper())
            else:
                result.append(new_char.lower())
        else:
            result.append(char.swapcase())
    return ''.join(result)
```